<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - document IDs in trailer dict should be printed as hex strings"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=97068">97068</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>document IDs in trailer dict should be printed as hex strings
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>poppler
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>poppler-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jakubkucharski97@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=125297" name="attach_125297" title="example PDF">attachment 125297</a> <a href="attachment.cgi?id=125297&action=edit" title="example PDF">[details]</a></span>
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
<span class="quote">>></span >
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
<span class="quote">>> </span >
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).</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>