The usage description suggests using an optional second argument for an output filename, e.g. "path/to/output.png". However, pdftocairo in fact always adds a number and additional suffix, e.g. "path/to/output.png-1.png", making the actual output filename somewhat unpredictable. Observed with poppler-0.28.1
I'm not seeing what the problem here is. The appended page number for the image formats is documented in the man page. The help summary is only intended to provide a reminder of the options. What specifically do you think needs to be changed?
(In reply to Adrian Johnson from comment #1) I must apologize for not reading and testing thoroughly. Indeed the output filename is perfectly predictable, once you know the meaning of "output filename". However, for the image formats, it is against expectations, and not consistent with the manual, which states: > The image formats (PNG, JPEG, and TIFF) generate one file per page > with the page number and file type appended to output-file > (except when -singlefile is used). When the output format is a vector > format (PDF, PS, EPS, and SVG) or when -singlefile is used, > output-file is the full filename Despite this, using -singlefile does append the file type, thus output-file is not a "full filename".
(In reply to Robert Sachunsky from comment #2) > Despite this, using -singlefile does append the file type, thus output-file > is not a "full filename". Yes, the behavior is inconsistent with man page. I checked pdftoppm -singlefile and it also appends the file type. I'll update the pdftocairo man page to correctly document the behavior of -singlefile.
I've pushed an update to the documentation to state that -singlefile appends the file type. If you want to specify the full name you can use '-' to write to stdout and redirect it to the file. Note there is a bug in writing to stdout with image files. I've also pushed a fix for this.
*** Bug 93024 has been marked as a duplicate of this bug. ***
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.