Bug 86254 - pdftocairo ignores output filename
Summary: pdftocairo ignores output filename
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: utils (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
: 93024 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-11-13 14:27 UTC by Robert Sachunsky
Modified: 2016-01-11 10:15 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Robert Sachunsky 2014-11-13 14:27:34 UTC
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
Comment 1 Adrian Johnson 2014-11-13 21:31:29 UTC
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?
Comment 2 Robert Sachunsky 2014-11-14 11:46:49 UTC
(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".
Comment 3 Adrian Johnson 2014-11-15 07:43:40 UTC
(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.
Comment 4 Adrian Johnson 2016-01-11 10:15:36 UTC
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.
Comment 5 Adrian Johnson 2016-01-11 10:15:59 UTC
*** 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.