-
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
Create a fallback annotation id
for entries in Annots
dictionaries that are not indirect objects (issue 7569)
#7570
Conversation
The patch looks good to me. A unit test would indeed be very helpful here. |
id
for entries in Annots
dictionaries that are not indirect objects (issue 7569)id
for entries in Annots
dictionaries that are not indirect objects (issue 7569)
…s that are not indirect objects (issue 7569) According to the PDF specification, see http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf#page=86, entries in `Annots` dictionaries should be indirect objects, but obviously there're PDF generators that ignore this. Fixes 7569.
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/25c3c4ab7dd40f7/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/e478f2421bfd528/output.txt |
@@ -80,8 +84,9 @@ AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ { | |||
var parameters = { | |||
xref: xref, | |||
dict: dict, | |||
ref: ref, | |||
ref: isRef(ref) ? ref : null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timvandermeij Please note that this change isn't necessary in order to fix #7569, but when looking through this file I noticed that there's currently one code-path where we're attempting to compare something to the annotation ref
(see https://github.com/mozilla/pdf.js/blob/master/src/core/annotation.js#L627-L644).
Hence I wanted to prevent a future issue by only passing in the ref
when it's actually valid.
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/25c3c4ab7dd40f7/output.txt Total script time: 23.60 mins
Image differences available at: http://107.22.172.223:8877/25c3c4ab7dd40f7/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/e478f2421bfd528/output.txt Total script time: 28.99 mins
Image differences available at: http://107.21.233.14:8877/e478f2421bfd528/reftest-analyzer.html#web=eq.log |
/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/4b70cca759d8a15/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/4b70cca759d8a15/output.txt Total script time: 1.02 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/c9bcba4c35419c5/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/a56dd0dd455ed91/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/a56dd0dd455ed91/output.txt Total script time: 24.00 mins
Image differences available at: http://107.22.172.223:8877/a56dd0dd455ed91/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/c9bcba4c35419c5/output.txt Total script time: 28.97 mins
Image differences available at: http://107.21.233.14:8877/c9bcba4c35419c5/reftest-analyzer.html#web=eq.log |
Looks good, thanks! |
@timvandermeij Thanks so much for reviewing this, and other PRs! |
According to the PDF specification, see http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf#page=86, entries in
Annots
dictionaries should be indirect objects, but obviously there're PDF generators that ignore this.Fixes #7569.
/cc @timvandermeij If you agree with the general idea of this patch, I'll add a unit-test as well.