-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Return ErrorFont in loadFont when the fontRef is undefined #4922
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
Conversation
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/baf29c1645fd70e/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/baf29c1645fd70e/output.txt Total script time: 0.73 mins Published
|
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/079ed930438d053/output.txt |
wow fantastic analysis! i was unable to get my head around it. |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/079ed930438d053/output.txt Total script time: 24.53 mins
|
/botio-windows test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/b0bfa7ec3a97b4d/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/b0bfa7ec3a97b4d/output.txt Total script time: 21.56 mins
|
Thank you for the pull request |
Return ErrorFont in loadFont when the fontRef is undefined
This patch enables loading of: http://www.cruiseshipportal.com/fileadmin/Downloads/CostaConcordia_study.pdf; as reported on IRC: http://logs.glob.uno/?c=mozilla%23pdfjs&s=10+Jun+2014&e=10+Jun+2014#c17609.
The following is an overview of the issues with this particular PDF file:
R34 (dict) [id: 34, gen: 0]
).CharProcs
dictionary, for thethree
character, there is a reference to the fontR98 (dict) [id: 98, gen: 0]
.fontRef
is undefined which causes an error preventing the first two pages from rendering.This patch changes
loadFont
to returnErrorFont
when thefontRef
is undefined, thus preventing errors like those described above.Obviously this isn't a complete solution, but it does reduce the severity of the issue considerably. I'm not even sure if solving this completely is actually feasible (and this kind of issue should be rare), given that it would require waiting for all font resources (hence all pages) to load before attempting to load e.g. Type3 fonts.