-
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
[api-minor] Add an IsLinearized
property to the PDFDocument.documentInfo
getter, to allow accessing the linearization status through the API (via PDFDocumentProxy.getMetadata
)
#9920
Conversation
Should we label this as |
/botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.215.176.217:8877/9272b47df4e4376/output.txt |
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/9272b47df4e4376/output.txt Total script time: 4.77 mins Published |
For completeness I'm also providing the Dutch translations. If you would like to include them in this patch, please feel free to do so; hopefully it helps. Here they are:
|
You're obviously correct (the change may be really small, but it's still adding "new" API functionality).
Nice, thank you! I'll add those as well soon (and probably some kind of localization comment too). |
…ion` Note first of all that `PDFDocument` will be initialized with either a `Stream` or a `ChunkedStream`, and that both of these have `length` getters. Secondly, the `PDFDocument` constructor will assert that the `stream` has a non-zero (and positive) length. Hence there's no point in checking `stream.length` in the `linearization` getter.
With this file now being a proper (ES6) module, it's no longer (technically) necessary for this structure to be lazily initialized. Considering its size, and simplicity, I therefore cannot see the harm in letting `DocumentInfoValidators` just be simple Object instead. While I'm not aware of any bugs caused by the current code, it cannot hurt to add an `isDict` check in `PDFDocument.documentInfo` (since the current code assumes that `infoDict` being defined implies it also being a Dictionary). Finally, the patch also converts a couple of `var` to `let`/`const`.
…ntInfo` getter, to allow accessing the linearization status through the API (via `PDFDocumentProxy.getMetadata`) There was a (somewhat) recent question on IRC about accessing the linearization status of a PDF document, and this patch contains a simple way to expose that through already existing API methods. Please note that during setup/parsing in `PDFDocument` the linearization data is already being fetched and parsed, provided of course that it exists. Hence this patch will *not* cause any additional data to be loaded.
ca49e08
to
1e7b6ab
Compare
This uses the same terminology, i.e. "Fast Web View", as is used by Adobe software.
1e7b6ab
to
522040d
Compare
IsLinearized
property to the PDFDocument.documentInfo
getter, to allow accessing the linearization status through the API (via PDFDocumentProxy.getMetadata
)IsLinearized
property to the PDFDocument.documentInfo
getter, to allow accessing the linearization status through the API (via PDFDocumentProxy.getMetadata
)
/botio-windows test |
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/5ef338543e524c3/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/5ef338543e524c3/output.txt Total script time: 3.02 mins Published |
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/287b24cca26b089/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.215.176.217:8877/0470f2b8094b351/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/287b24cca26b089/output.txt Total script time: 19.50 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/0470f2b8094b351/output.txt Total script time: 27.21 mins
|
I really like this feature. Nice work! |
Please refer to the individual commit messages for additional details.