-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix loading of PDF files with invalid or missing Type3 characters (issue 5039) #5077
Conversation
Nice work, I can confirm the fix. |
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/b2aa1fd13da8075/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/8caebec31111cc5/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/8caebec31111cc5/output.txt Total script time: 21.40 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/b2aa1fd13da8075/output.txt Total script time: 23.50 mins
|
/botio makeref |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/e678a3e4b22a2d4/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/237f1aeaf345b4b/output.txt |
Fix loading of PDF files with invalid or missing Type3 characters (issue 5039)
Thank you for the patch |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/237f1aeaf345b4b/output.txt Total script time: 21.41 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/e678a3e4b22a2d4/output.txt Total script time: 23.46 mins
|
Fixes #5039.
This PR actually addresses two different Type3 issues:
In the file in the issue, the offending font resource is the one for the "space" character. If we just catch the Promise rejection (in
evaluator.js
) all pages would finish rendering.However there would be no spaces present between words, which is thus solved by adding an empty
OperatorList
to thecharProcOperatorList
array.evaluator.js
is actually enough.But when I created the test case, I accidentally stumbled on another issue: if a
showText
command for a Type3 font contains a reference to a character not present in the font, the page won't finish rendering. Hence the changes tocanvas.js
to address this, hopefully rare, case.