pdftoppm does not return error code when conversion is unsuccessful
I asked on the #poppler IRC channel an was told to open an issue.
When converting a PDF for which the host machine does not have the fonts, errors will be written to the stderr but the returned error code will still be 0 (which implies no issue with the conversion).
I'd expect it to return a specific error code for missing font.
Is this expected behavior?
Steps to reproduce:
Someone was kind enough to make a docker container to replicate the exact use case.
- Pull the docker file
docker run -it bpdev97/pdf2image-font-example /bin/bash
- Convert a pdf (one for which there are missing fonts is provided)
pdftoppm -r 150 -png test.pdf out
- echo the last return code
This will print 0 yet the you will see a bunch of
Syntax Error: Couldn't find a font for 'Helvetica' in the output.
The resulting PNG file will be blank.
Github issue for reference: https://github.com/Belval/pdf2image/issues/37