<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Documents opened via poppler_document_new_from_stream() do not render correctly"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=82630">82630</a>
          </td>
        </tr>

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

        <tr>
          <th>Summary</th>
          <td>Documents opened via poppler_document_new_from_stream() do not render correctly
          </td>
        </tr>

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

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>phillip.berndt@googlemail.com
          </td>
        </tr>

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

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

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

        <tr>
          <th>Component</th>
          <td>glib frontend
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>poppler
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=104631" name="attach_104631" title="Example program">attachment 104631</a> <a href="attachment.cgi?id=104631&action=edit" title="Example program">[details]</a></span>
Example program

Files loaded through the poppler_document_new_from_stream() call seem not to be
loaded correctly. While I can access all pages from PDFs, rendering fails
halfway through a page, and on stderr I see

Syntax Error (153504): Unexpected end of file in flate stream
Syntax Error: Unterminated string
Syntax Error: End of file inside array
Syntax Error: Leftover args in content stream

If I load the same file into a char array and use
poppler_document_new_from_data(), the file renderes fine.

I'll attach an example program, example PDF file, and screenshots of expected
and actual renderings. I've compiled the example using

cc test.c -o test $(pkg-config --libs --cflags gtk+-3.0 glib-2.0 cairo gio-2.0
poppler-glib)

and tested against a clean build of the latest poppler git (commit e62e18e).</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>