<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Regression: pdf that used to work in 0.24.5 fails in 0.45.0"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=96884#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Regression: pdf that used to work in 0.24.5 fails in 0.45.0"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=96884">bug 96884</a>
              from <span class="vcard"><a class="email" href="mailto:phillip.berndt@googlemail.com" title="Phillip Berndt <phillip.berndt@googlemail.com>"> <span class="fn">Phillip Berndt</span></a>
</span></b>
        <pre>Indeed, the demo works here as well. I dug a bit deeper into this and found
that the error is in the poppler_document_new_from_stream() call of the glib
interface.

Files opened via poppler_document_new_from_file() and
poppler_document_new_from_data(), respectively, work fine.

This fails:

-----8<----------------------------

// gcc -o test test.c `pkg-config --libs --cflags glib-2.0 poppler-glib`
// to compile
#include <stdio.h>
#include <glib.h>
#include <poppler.h>

int main(int argc, char *argv[]) {
        GError *error_pointer = NULL;
        GFile *file = g_file_new_for_path(argv[1]);
        GFileInputStream *stream = g_file_read(file, NULL, &error_pointer);
        PopplerDocument *doc =
poppler_document_new_from_stream(G_INPUT_STREAM(stream), -1, NULL, NULL,
&error_pointer);

        if(error_pointer) {
                printf("Error: %s\n", error_pointer->message);
        }
}

----->8----------------------------</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>