-
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
Render interactive form (AcroForm) text widget annotations #7602
Conversation
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/d24d9fa8f2fa50b/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/d24d9fa8f2fa50b/output.txt Total script time: 1.24 mins Published |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/aa077da287ad638/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/a2961c905925f49/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/aa077da287ad638/output.txt Total script time: 24.18 mins
Image differences available at: http://107.22.172.223:8877/aa077da287ad638/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/a2961c905925f49/output.txt Total script time: 38.55 mins
Image differences available at: http://107.21.233.14:8877/a2961c905925f49/reftest-analyzer.html#web=eq.log |
Review status: 0 of 7 files reviewed at latest revision, 3 unresolved discussions. a discussion (no related file): Besides the inline comments, pretty please add reference (and if applicable perhaps also unit) tests! My suggestion is to add a src/display/annotation_layer.js, line 442 [r1] (raw file):
Let's pass in a (We can always improve on these things later on, e.g. how the preference is passed along to the annotationLayer, when we get closer to enabling annotations by default.) src/display/dom_utils.js, line 213 [r1] (raw file):
Please note the comment at the top of this list: // The list of the settings and their default is maintained for backward
// compatibility and shall not be extended or modified. See also global.js. Since this is a new setting, it shouldn't be added here. Please see the other comments for another approach. Comments from Reviewable |
Thank you for the review! I had planned to implement unit/reference testing in the next PR, but I can see how it will already be useful here and hopefully it should not take too much code to implement, so I'll instead do that for this PR (in a separate commit) as you suggested. |
3d8e071
to
be6838d
Compare
Review status: 0 of 7 files reviewed at latest revision, 4 unresolved discussions. web/annotation_layer_builder.js, line 83 [r2] (raw file):
Please use Comments from Reviewable |
This patch is the first step towards implementing support for interactive forms (AcroForms). It makes it possible to render text widget annotations exactly like Adobe Reader/Acrobat. Everything we implement for AcroForms is disabled by default using a preference, mainly because it is not ready to use yet, but has to implemented in many steps to avoid complexity. The preference allows us to work with the code while not exposing the behavior by default. Mainly storing entered values and printing them is still absent, which would be minimal requirements for enabling this by default.
d91ad0a
to
18cf425
Compare
I have addressed the comments. Reference testing has been enabled in a new commit. This can be tested locally by removing all entries from |
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/7c391bd84d1e69b/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/7c391bd84d1e69b/output.txt Total script time: 1.26 mins Published |
/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/ef40f52caa1ef3e/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/887baf84acdd5f9/output.txt |
Review status: 0 of 10 files reviewed at latest revision, 6 unresolved discussions. test/test_manifest.json, line 735 [r4] (raw file):
Let's make this test/test_manifest.json, line 741 [r4] (raw file):
Would it be possible to implement the Line 486 in 8dbb5a7
Comments from Reviewable |
18cf425
to
e281ce7
Compare
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/887baf84acdd5f9/output.txt Total script time: 24.29 mins
Image differences available at: http://107.22.172.223:8877/887baf84acdd5f9/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/ef40f52caa1ef3e/output.txt Total script time: 39.83 mins
Image differences available at: http://107.21.233.14:8877/ef40f52caa1ef3e/reftest-analyzer.html#web=eq.log |
The review comments have been addressed, so let's re-run the tests to be sure that the changes are fine. /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/368cd609575fbfa/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/1a7aab5be168de4/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/1a7aab5be168de4/output.txt Total script time: 24.46 mins
Image differences available at: http://107.22.172.223:8877/1a7aab5be168de4/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/368cd609575fbfa/output.txt Total script time: 39.02 mins
Image differences available at: http://107.21.233.14:8877/368cd609575fbfa/reftest-analyzer.html#web=eq.log |
Reviewed 5 of 7 files at r1, 1 of 3 files at r2, 1 of 1 files at r3, 2 of 3 files at r4, 2 of 2 files at r5. a discussion (no related file): /botio makeref Comments from Reviewable |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/dcf12d6ca6c8230/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/a0a214127b8aa98/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/dcf12d6ca6c8230/output.txt Total script time: 24.36 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/a0a214127b8aa98/output.txt Total script time: 37.78 mins
|
This patch is the first step towards implementing support for interactive forms (AcroForms). It makes it possible to render text widget annotations exactly like Adobe Reader/Acrobat.
Everything we implement for AcroForms is disabled by default using a preference, mainly because it is not ready to use yet, but has to implemented in many steps to avoid complexity. The preference allows us to work with the code while not exposing the behavior by default. Mainly storing entered values and printing them is still absent, which would be minimal requirements for enabling this by default. The default behavior is therefore unchanged.
You can test the functionality using http://web.archive.org/web/20110918100215/http://www.irs.gov/pub/irs-pdf/f1040.pdf (from https://github.com/mozilla/pdf.js/blob/master/test/pdfs/f1040.pdf.link) and setting the preference
renderInteractiveForms
totrue
.@Snuffleupagus Could you review this PR? I talked to Yury on IRC and he agreed that the preference approach is most useful here so we can iterate on this.
Easier reviewing with https://github.com/mozilla/pdf.js/pull/7602/files?w=1.