[Poppler-bugs] [Bug 97068] New: document IDs in trailer dict should be printed as hex strings
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Sun Jul 24 21:14:32 UTC 2016
https://bugs.freedesktop.org/show_bug.cgi?id=97068
Bug ID: 97068
Summary: document IDs in trailer dict should be printed as hex
strings
Product: poppler
Version: unspecified
Hardware: Other
OS: All
Status: NEW
Severity: normal
Priority: medium
Component: general
Assignee: poppler-bugs at lists.freedesktop.org
Reporter: jakubkucharski97 at gmail.com
Created attachment 125297
--> https://bugs.freedesktop.org/attachment.cgi?id=125297&action=edit
example PDF
Example 3.7 in the PDF reference v7 (page 98) shows an example of a trailer
dictionary. Two file identifiers are printed as hex strings and this is what
non-poppler PDF software usually does. Poppler now reads hex strings correctly,
but then treats like ordinary strings and prints them as ordinary strings.
Because of that e.g. even though after an incremental update the first file
identifier should stay the same, what actually gets printed is junk. And it is
printed between round brackets instead of angle brackets (as it is supposed to
be printed). An example:
1. Compile the attached "setprops.c" with poppler-glib from the git tree.
I do it with: gcc -o setprops setprops.c
-I/poppler/install/path/include/poppler/glib/ -L/poppler/install/path/lib/
-lpoppler -lpoppler-glib $(pkg-config --cflags --libs gio-2.0 poppler-cairo)
2. Run
"LD_PRELOAD=/poppler/install/path/lib/libpoppler.so:/poppler/install/path/lib/libpoppler-glib.so
./setprops path_to_pdf", where path_to_pdf is a path to the attached PDF file.
3. Run "tail path_to_pdf"
4. Run "tail path_to_pdf.new"
Output of the 3rd step:
<<
/Info 718 0 R
/ID [<4e7fff73ae86ee9a299d94b54d10c453> <8b805dbbee6d2d4b94948ad9307e4328>]
/Root 643 0 R
/Size 719
>>
startxref
921857
%%EOF
Output of the 4th step:
xref
0 1
0000000001 65535 f
718 1
0000936400 00000 n
trailer
<</Size 719 /ID [(Ns)M) ( y[NS|@7) ] /Root 643 0 R /Prev 921857 /Info 718 0 R
>>
startxref
936697
%%EOF
Do the same with my patches (remember to recompile setprops.c) and the output
of the 4th step is:
xref
0 1
0000000001 65535 f
718 1
0000936400 00000 n
trailer
<</Size 719 /ID
[<4e7fff73ae86ee9a299d94b54d10c453><42d9ded05c067ac3a02ac0807ee11b6d>] /Root
643 0 R /Prev 921857 /Info 718 0 R >>
startxref
936697
%%EOF
Looks fine and the first file identifier remained untouched (as it is supposed
to).
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20160724/c47b4140/attachment.html>
More information about the Poppler-bugs
mailing list