-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[api-minor] Introduce a new annotationMode
-option, in PDFPageProxy.{render, getOperatorList}
#13923
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
e745f84
to
8d171af
Compare
/botio test |
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/0e98c35cec25aac/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://3.101.106.178:8877/7455ea80382b00d/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/0e98c35cec25aac/output.txt Total script time: 33.48 mins
Image differences available at: http://54.67.70.0:8877/0e98c35cec25aac/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://3.101.106.178:8877/7455ea80382b00d/output.txt Total script time: 39.54 mins
Image differences available at: http://3.101.106.178:8877/7455ea80382b00d/reftest-analyzer.html#web=eq.log |
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/bbee02ac9757398/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/bbee02ac9757398/output.txt Total script time: 5.37 mins Published |
8d171af
to
3aa624a
Compare
I think this is still considered a major version change since it removes/changes arguments to the API. A user could not take this version if they had used some different values and seamlessly upgrade. We'll need to either 1) do a major release or 2) convert this to a minor release and leave the old options and mark them as deprecated and have them populate the new arguments. |
Well, this wouldn't exactly be the first time that we've made strictly speaking backwards incompatible changes in
The issue is then exactly how to do that conversion consistently and correctly, since a pretty big issue in the current implementation is that as mentioned above the two old options are unfortunately mutually exclusive!? Edit: I've now tried to add fallback values for the old options, which should hopefully cover most use-cases. In particular the |
….{render, getOperatorList}` *This is a follow-up to PRs 13867 and 13899.* This patch is tagged `api-minor` for the following reasons: - It replaces the `renderInteractiveForms`/`includeAnnotationStorage`-options, in the `PDFPageProxy.render`-method, with the single `annotationMode`-option that controls which annotations are being rendered and how. Note that the old options were mutually exclusive, and setting both to `true` would result in undefined behaviour. - For improved consistency in the API, the `annotationMode`-option will also work together with the `PDFPageProxy.getOperatorList`-method. - It's now also possible to disable *all* annotation rendering in both the API and the Viewer, since the other changes meant that this could now be supported with a single added line on the worker-thread[1]; fixes 7282. --- [1] Please note that in order to simplify the overall implementation, we'll purposely only support disabling of *all* annotations and that the option is being shared between the API and the Viewer. For any more "specialized" use-cases, where e.g. only some annotation-types are being rendered and/or the API and Viewer render different sets of annotations, that'll have to be handled in third-party implementations/forks of the PDF.js code-base.
2365431
to
23b47d3
Compare
…eAnnotationStorage` options, in `PDFPageProxy.render` *This is done separately from the previous patch, to make it easier to revert these changes once they've been included in a couple of releases.* Please note that because these two options are mutually exclusive, which is a large part of the reason for the previous patch, it's not guaranteed that the fallback-values will always be correct in every situation (but it's the best that we can do).
23b47d3
to
2a0ad8e
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.67.70.0:8877/e12ffa769892503/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://3.101.106.178:8877/c7b4675ade3eea5/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/e12ffa769892503/output.txt Total script time: 27.89 mins
Image differences available at: http://54.67.70.0:8877/e12ffa769892503/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://3.101.106.178:8877/c7b4675ade3eea5/output.txt Total script time: 40.10 mins
Image differences available at: http://3.101.106.178:8877/c7b4675ade3eea5/reftest-analyzer.html#web=eq.log |
/botio browsertest |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/3ce139219a53f35/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://3.101.106.178:8877/7e5a1cdc10e9ff4/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/3ce139219a53f35/output.txt Total script time: 24.24 mins
Image differences available at: http://54.67.70.0:8877/3ce139219a53f35/reftest-analyzer.html#web=eq.log |
/botio-linux browsertest |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/cfdc7780a1bacd5/output.txt |
From: Bot.io (Windows)FailedFull output at http://3.101.106.178:8877/7e5a1cdc10e9ff4/output.txt Total script time: 35.58 mins
Image differences available at: http://3.101.106.178:8877/7e5a1cdc10e9ff4/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/cfdc7780a1bacd5/output.txt Total script time: 24.20 mins
Image differences available at: http://54.67.70.0:8877/cfdc7780a1bacd5/reftest-analyzer.html#web=eq.log |
/botio-linux browsertest |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/223e38131381a6e/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/223e38131381a6e/output.txt Total script time: 23.72 mins
Image differences available at: http://54.67.70.0:8877/223e38131381a6e/reftest-analyzer.html#web=eq.log |
/botio-linux browsertest |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/c8a2057ea7de018/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/c8a2057ea7de018/output.txt Total script time: 23.87 mins
Image differences available at: http://54.67.70.0:8877/c8a2057ea7de018/reftest-analyzer.html#web=eq.log |
/botio-linux browsertest |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/35ac4a66ec9c8ba/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/35ac4a66ec9c8ba/output.txt Total script time: 29.69 mins
Image differences available at: http://54.67.70.0:8877/35ac4a66ec9c8ba/reftest-analyzer.html#web=eq.log |
Really nice work! The previous options indeed grew over time with all the forms and storage work, so it's good to re-evaluate that and introduce a single option that captures all variants. |
Hi! When will the new I would like to update my usage of the library to this. |
This patch will be part of the upcoming pre-release (beta) version, but we don't have a release date yet. |
These changes look promising! Question: How could I use the library to render only the annotations layer? Thanks |
This is a follow-up to PRs #13867 and #13899.
This patch is tagged
api-minor
for the following reasons:It replaces the
renderInteractiveForms
/includeAnnotationStorage
-options, in thePDFPageProxy.render
-method, with the singleannotationMode
-option that controls which annotations are being rendered and how. Note that the old options were mutually exclusive, and setting both totrue
would result in undefined behaviour.For improved consistency in the API, the
annotationMode
-option will also work together with thePDFPageProxy.getOperatorList
-method.It's now also possible to disable all annotation rendering in both the API and the Viewer, since the other changes meant that this could now be supported with a single added line on the worker-thread[1]; fixes Option to disable showing of PDF annotations #7282.
[1] Please note that in order to simplify the overall implementation, we'll purposely only support disabling of all annotations and that the option is being shared between the API and the Viewer. For any more "specialized" use-cases, where e.g. only some annotation-types are being rendered and/or the API and Viewer render different sets of annotations, that'll have to be handled in third-party implementations/forks of the PDF.js code-base.