[Poppler-bugs] [Bug 104877] New: Poppler-INFO: Syntax error at position -1: Document stream is empty with poppler_document_new_from_stream()

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jan 31 08:40:57 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=104877

            Bug ID: 104877
           Summary: Poppler-INFO: Syntax error at position -1: Document
                    stream is empty with
                    poppler_document_new_from_stream()
           Product: poppler
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: glib frontend
          Assignee: poppler-bugs at lists.freedesktop.org
          Reporter: kenhys at gmail.com

Created attachment 137076
  --> https://bugs.freedesktop.org/attachment.cgi?id=137076&action=edit
sample source code which reproduces it

# Problem

poppler_document_new_from_stream() causes syntax error. In the contrast,
poppler_document_new_from_file() doesn't cause an error even though same pdf
file is used.

Here is the actual reported errors.

  + G_MESSAGES_DEBUG=Poppler ./poppler-glib-document-new                        
  poppler_document_new_from_file()                                              
  poppler_document_new_from_stream()                                            
  Poppler-INFO: Syntax error at position 22: Illegal character <21> in hex
string 
  Poppler-INFO: Syntax error at position 23: Illegal character <59> in hex
string 
  Poppler-INFO: Syntax error at position 24: Illegal character <f3> in hex
string 
  Poppler-INFO: Syntax error at position 25: Illegal character <2e> in hex
string                     
  Poppler-INFO: Syntax error at position 26: Illegal character <97> in hex
string

It seems that this error occurs on master.

# Expected

Not only poppler_document_new_from_file(), but also
poppler_document_new_from_stream() doesn't cause a syntax error with attached
sample code because both of function handles same pdf file.

# Actual

I've tested attached sample code on debian unstable.(poppler 0.61, poppler-data
0.4.8)

  $ dpkg -l G poppler
  ii  gir1.2-poppler-0.18:amd64             0.61.1-2                           
  amd64        GObject introspection data for poppler-glib
  ii  libpoppler-dev:amd64                  0.61.1-2                           
  amd64        PDF rendering library -- development files
  ii  libpoppler-glib-dev                   0.61.1-2                           
  amd64        PDF rendering library -- development files (GLib interface)
  ii  libpoppler-glib8:amd64                0.61.1-2                           
  amd64        PDF rendering library (GLib-based shared library)
  ii  libpoppler72:amd64                    0.61.1-2                           
  amd64        PDF rendering library
  ii  poppler-data                          0.4.8-2                            
  all          encoding data for the poppler PDF rendering library
  ii  poppler-utils                         0.61.1-2                           
  amd64        PDF utilities (based on Poppler)

In above environment, attached code returns "Syntax error at position xx:".

  + TARGET=poppler-glib-document-new
  + pkg-config --cflags --libs poppler-glib cairo-pdf gio-2.0
  + cc -o poppler-glib-document-new poppler-glib-document-new.c -pthread
-I/usr/include/poppler/glib -I/usr/include/poppler -I/usr/include/cairo
-I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
-lpoppler-glib -lz -lcairo -lgio-2.0 -lgobject-2.0 -lglib-2.0
  + [ 0 -eq 0 ]
  + G_MESSAGES_DEBUG=Poppler ./poppler-glib-document-new
  poppler_document_new_from_file()
  poppler_document_new_from_stream()
  Poppler-INFO: Syntax error at position 22: Illegal character <21> in hex
string
  Poppler-INFO: Syntax error at position 23: Illegal character <59> in hex
string
  Poppler-INFO: Syntax error at position 24: Illegal character <f3> in hex
string
  Poppler-INFO: Syntax error at position 25: Illegal character <2e> in hex
string
  Poppler-INFO: Syntax error at position 26: Illegal character <97> in hex
string

As poppler version is a bit old, I've also tested with master.

 
https://cgit.freedesktop.org/poppler/poppler/commit/?id=248aa0f5832ce063a9ae061dfcf54596e0ea5fba

But, it causes syntax error.

  + TARGET=poppler-glib-document-new
  + export PKG_CONFIG_PATH=/home/kenhys/.local/lib/pkgconfig
  + pkg-config --cflags --libs poppler poppler-glib cairo-pdf gio-2.0
  + cc -o poppler-glib-document-new poppler-glib-document-new.c -pthread
-I/home/kenhys/.local/include/poppler/glib
-I/home/kenhys/.local/include/poppler -I/usr/include/cairo
-I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
-L/home/kenhys/.local/lib -lpoppler -lpoppler-glib -lz -lcairo -lgio-2.0
-lgobject-2.0 -lglib-2.0
  + [ 0 -eq 0 ]
  + LD_LIBRARY_PATH=/home/kenhys/.local/lib G_MESSAGES_DEBUG=Poppler
./poppler-glib-document-new
  poppler_document_new_from_file()
  poppler_document_new_from_stream()
  Poppler-INFO: Syntax error at position -1: Document stream is empty
  Error: Failed to load document

-- 
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/20180131/9e74d1d4/attachment-0001.html>


More information about the Poppler-bugs mailing list