Bug 70374

Summary: No user-control over error messages
Product: poppler Reporter: Hans-Peter Deifel <hpdeifel>
Component: cpp frontendAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: medium CC: flo
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch to add API to the cpp wrapper

Description Hans-Peter Deifel 2013-10-11 12:15:31 UTC
poppler-cpp unconditionally prints all error messages from poppler to stderr. A user has no way to prevent this or install her own error handler.

Control over the error output would be very desirable for command line programs.

Since errors are also printed when an encrypted PDF document is opened without a password, there is no way to check if a PDF requires a password without generating an ugly error message.

Qt and GLib frontends both expose an equivalent of setErrorCallback.

I'd gladly volunteer to implement this myself, if I get some pointers about how the API should look.
Comment 1 Albert Astals Cid 2013-10-12 14:52:04 UTC
I'd go for something similar to what the qt4 API does but with a std::string and a void * instead of a QString and a QVariant.
Comment 2 Hans-Peter Deifel 2014-12-12 12:18:42 UTC
Created attachment 110775 [details] [review]
Patch to add API to the cpp wrapper

I finally came around to implement this API, sorry it took so long.
Comment 3 Albert Astals Cid 2014-12-14 13:59:21 UTC
Awesome, commited!

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.