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

Issue a warning instead of an error for long Names #6193

Merged
merged 1 commit into from
Jul 10, 2015

Conversation

Rob--W
Copy link
Member

@Rob--W Rob--W commented Jul 10, 2015

Fixes #6151

The PDF specification (cited below) specifies a maximum length of a name in bytes as a minimal architectural limit. This means that PDF writers should not create names that exceed 127 bytes.

It does not forbid PDF readers to accept such names though. These names are only used internally to link PDF objects to other objects. For these use cases, the lengths of the names do not really matter. Hence I have changed the implementation to not treat long names as errors, but warnings.

(7.3.5) The length of a name shall be subject to an implementation limit; see Annex C.

(Annex C.2) Table C.1 describes the minimum architectural limits that should be accommodated by conforming readers running on 32-bit machines. Because conforming readers may be subject to these limits, conforming writers producing PDF files should remain within them.

(Table C.1) name 127 "Maximum length of a name, in bytes."

-- http://adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf

The PDF specification (cited below) specifies a maximum length of a name
in bytes as a minimal architectural limit. This means that PDF *writers*
should not create names that exceed 127 bytes.

It does not forbid PDF *readers* to accept such names though. These
names are only used internally to link PDF objects to other objects. For
these use cases, the lengths of the names do not really matter. Hence I
have changed the implementation to not treat long names as errors, but
warnings.

> (7.3.5) The length of a name shall be subject to an implementation
> limit; see Annex C.
>
> (Annex C.2) Table C.1 describes the minimum architectural limits that
> should be accommodated by conforming readers running on 32-bit
> machines. Because conforming readers may be subject to these limits,
> conforming writers producing PDF files should remain within them.
>
> (Table C.1) name 127 "Maximum length of a name, in bytes."

http://adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf
@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/40766676f713377/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/c76b4bd05d69460/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

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

Total script time: 18.58 mins

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

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/40766676f713377/output.txt

Total script time: 18.97 mins

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

@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/903338cafabeeb0/output.txt

@timvandermeij timvandermeij self-assigned this Jul 10, 2015
timvandermeij added a commit that referenced this pull request Jul 10, 2015
Issue a warning instead of an error for long Names
@timvandermeij timvandermeij merged commit 6c1906f into mozilla:master Jul 10, 2015
@timvandermeij
Copy link
Contributor

Nice, thanks!

@griffinmyers
Copy link

Thanks so much @timvandermeij, @Rob--W @Snuffleupagus and anyone else who took a second on the issue! Love the enthusiasm with which this was addressed. Great example of maintaining a great tool.

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

Successfully merging this pull request may close these issues.

4 participants