Rendering issues with some PDF + GObject + Cairo
I'm developing Paperwork (Python+GTK), and I use Poppler to extract text from PDF files and display them.
On some (rare) PDF files, some of my users have reported getting uncaught exceptions
cairo.Error: invalid value for a dash setting when Paperwork tries to render the PDF with Poppler and Cairo. For instance: ticket #913 on my side ; other users have reported this very same problem too. Weirdly, the PDF is still correctly drawn on screen.
I've narrowed it down to this Python test script: test.py. I've compiled and installed Poppler from Git (master), and I still can reproduce this issue.
The user who opened the ticket on my side #913 has sent me by email a PDF to reproduce the problem. Unfortunately, this PDF contains personal information, so I cannot upload it on this ticket. However, he has allowed me to share it privately with any Poppler developers.
The problem doesn't seem to happen with Evince, which suggests it's related to the GObject Introspection bindings.
Interestingly, if you remove the calls to
cairo_context.restore(), there are still some cairo warnings in the console, but not uncaught exception anymore.