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.
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.
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.
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.