Skip to content
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

Merged
merged 1 commit into from
Aug 27, 2016

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Aug 26, 2016

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.

@timvandermeij
Copy link
Contributor

The patch looks good to me. A unit test would indeed be very helpful here.

@Snuffleupagus Snuffleupagus changed the title [WIP] Create a fallback annotation id for entries in Annots dictionaries that are not indirect objects (issue 7569) Create a fallback annotation id for entries in Annots dictionaries that are not indirect objects (issue 7569) Aug 27, 2016
…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.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.22.172.223:8877/25c3c4ab7dd40f7/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command 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,
Copy link
Collaborator Author

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.

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://107.22.172.223:8877/25c3c4ab7dd40f7/output.txt

Total script time: 23.60 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://107.22.172.223:8877/25c3c4ab7dd40f7/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Linux)


Failed

Full output at http://107.21.233.14:8877/e478f2421bfd528/output.txt

Total script time: 28.99 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://107.21.233.14:8877/e478f2421bfd528/reftest-analyzer.html#web=eq.log

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/4b70cca759d8a15/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/4b70cca759d8a15/output.txt

Total script time: 1.02 mins

Published

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/c9bcba4c35419c5/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.22.172.223:8877/a56dd0dd455ed91/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://107.22.172.223:8877/a56dd0dd455ed91/output.txt

Total script time: 24.00 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://107.22.172.223:8877/a56dd0dd455ed91/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Linux)


Failed

Full output at http://107.21.233.14:8877/c9bcba4c35419c5/output.txt

Total script time: 28.97 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://107.21.233.14:8877/c9bcba4c35419c5/reftest-analyzer.html#web=eq.log

@timvandermeij timvandermeij merged commit f520616 into mozilla:master Aug 27, 2016
@timvandermeij
Copy link
Contributor

Looks good, thanks!

@Snuffleupagus
Copy link
Collaborator Author

@timvandermeij Thanks so much for reviewing this, and other PRs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants