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

Token '-0.' treated as string rather than decimal #165

Closed
jbarlow83 opened this issue Nov 24, 2017 · 1 comment
Closed

Token '-0.' treated as string rather than decimal #165

jbarlow83 opened this issue Nov 24, 2017 · 1 comment

Comments

@jbarlow83
Copy link
Contributor

The attached file produces these warnings:

checking negative_zero_decimal.pdf
PDF Version: 1.3
File is not encrypted
File is not linearized
WARNING: _this_one_warns.pdf (file position 70213): unknown token while reading object; treating as string
WARNING: _this_one_warns.pdf (file position 70988): unknown token while reading object; treating as string
WARNING: _this_one_warns.pdf (file position 71751): unknown token while reading object; treating as string
WARNING: _this_one_warns.pdf (file position 72369): unknown token while reading object; treating as string
WARNING: _this_one_warns.pdf (file position 73138): unknown token while reading object; treating as string

When QPDF rewrites the file, the rewritten version eliminates the warning.

At the file positions it complains about, the token is always -0., as one of the values in a transformation matrix inside the file.

As I understand the PDF spec (7.3.3) that token should be interpreted as a real number (sign, digit, trailing period).

A real value shall be written as one or more decimal digits with an optional sign and a leading, trailing, or embedded PERIOD (2Eh) (decimal point). The value shall be interpreted as a real number and shall be converted to a real object.

negative_zero_decimal.pdf

@jberkenbilt
Copy link
Contributor

Thanks for reporting. If the qpdf tokenizer is failing to interpret a number with a trailing period as a floating point number, this will be an easy fix, and I can get it in next time I make some updates.

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

No branches or pull requests

2 participants