If poppler_document_new_from_data() is fed a corrupt PDF, this output goes to stderr rather than being put to the GError* passed to it: Error: May not be a PDF file (continuing anyway) Error: PDF file is damaged - attempting to reconstruct xref table... Error: Couldn't find trailer dictionary Error: Couldn't read xref table Error: PDF file is damaged - attempting to reconstruct xref table... In order to stop this output from going to stderr, one must use libpoppler's setErrorFunction() from Error.h, which is not part of the glib interface. It would be better if either (1) the glib interface caught these warnings and returned them in the GError*, or (2) gave some indication in the documentation that one needs to set one's own error handler to do this. I'm reporting this against poppler 0.18.4 on Fedora 17.
Created attachment 72699 [details] [review] forward poppler warnings through g_warning Would something like in this patch work? This forwards poppler's error messages through glib's message logging. Then messages can be captured through g_log_set_handler using "Poppler" for the domain.
(In reply to comment #1) > Created attachment 72699 [details] [review] [review] > forward poppler warnings through g_warning > > Would something like in this patch work? This forwards poppler's error > messages through glib's message logging. Then messages can be captured > through g_log_set_handler using "Poppler" for the domain. That would be great, thanks.
*** This bug has been marked as a duplicate of bug 73269 ***
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.