Bug 92195 - pdftocairo does not report some errors
Summary: pdftocairo does not report some errors
Status: RESOLVED MOVED
Alias: None
Product: poppler
Classification: Unclassified
Component: utils (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-30 14:19 UTC by a3nm
Modified: 2018-08-21 11:18 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description a3nm 2015-09-30 14:19:34 UTC
The pdftocairo command line tool does not report certain errors. The cases which I have observed are:

- when specifying the -scale-to option for conversions to types that do not accept it (e.g., for SVG), the option and its value are ignored with no error message

- when only one of -paperw and -paperh are specified, both are silently ignored

- when giving to -paperw or -paperh a non-integer value (e.g., "42.3"), or indeed any other erroneous value that cannot be parsed as an integer, the conversion is aborted and no error message is displayed (only the exit code reflects that something went wrong); by contrast negative integers do not make the conversion fail but mean that -paperw and -paperh are silently ignored.

I think pdftocairo should display an error when the conversion was not actually performed, and display warnings (or display an error and fail) when some parameters were ignored.
Comment 1 Adrian Johnson 2016-01-11 11:38:03 UTC
I've pushed a fix for the invalid use of -scale-to, use of only one of -paper[wh], and non-integer -paper[wh]

I'll leave this bug open until the failure to error on the use of negative integers is fixed. This should probably be fixed in parseargs.cc (eg by adding a positive integer arg type). Then all arguments across all the utils that only take positive integers can be updated to use this type.

I may also consider changing -paper[wh] to floating-point. I don't think there is any reason to restrict the paper size to an integer.
Comment 2 GitLab Migration User 2018-08-21 11:18:50 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/614.


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.