-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Slightly re-factor how we pre-load fonts and images in XFA documents #19889
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 xfatest |
From: Bot.io (Linux m4)ReceivedCommand cmd_xfatest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/29d2f25555032ec/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_xfatest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/10a0e1fd07f99df/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/29d2f25555032ec/output.txt Total script time: 17.14 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/10a0e1fd07f99df/output.txt Total script time: 40.75 mins
|
Considering the name of the method, and how it's actually being used, you'd expect it to return a boolean value. Given how it's currently being used this inconsistency doesn't cause any issues, however we should still fix this.
Currently we repeat virtually the same code when calling the `PartialEvaluator.prototype.handleSetFont` method, which we can avoid by introducing an inline helper function.
Rather than "manually" invoking the methods from the `src/core/worker.js` file we introduce a single `PDFDocument`-method that handles this for us, and make the current methods private. Since this code is only invoked at most *once* per document, and only for XFA documents, we can use `BasePdfManager.prototype.ensureDoc` directly rather than needing a stand-alone method.
ab98885
to
d9548b1
Compare
/botio xfatest |
From: Bot.io (Linux m4)ReceivedCommand cmd_xfatest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/c7dedb8e511b4f3/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_xfatest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/3d70dde3da6125d/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/c7dedb8e511b4f3/output.txt Total script time: 17.23 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/3d70dde3da6125d/output.txt Total script time: 40.00 mins
|
Nice simplification! |
Ensure that
XFAFactory.prototype.isValid
returns a boolean valueConsidering the name of the method, and how it's actually being used, you'd expect it to return a boolean value.
Given how it's currently being used this inconsistency doesn't cause any issues, however we should still fix this.
Reduce duplication when parsing fonts in
loadXfaFonts
Currently we repeat virtually the same code when calling the
PartialEvaluator.prototype.handleSetFont
method, which we can avoid by introducing an inline helper function.Slightly re-factor how we pre-load fonts and images in XFA documents
Rather than "manually" invoking the methods from the
src/core/worker.js
file we introduce a singlePDFDocument
-method that handles this for us, and make the current methods private.Since this code is only invoked at most once per document, and only for XFA documents, we can use
BasePdfManager.prototype.ensureDoc
directly rather than needing a stand-alone method.