pdf2ps creates empty output

Bug #241544 reported by StefanS42376868
4
Affects Status Importance Assigned to Milestone
ghostscript (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: ghostscript

If I try to convert a valid PDF file, which I have previously created by printing to "PDF" printer in Ubuntu 8.04, to postscript via pdf2ps I will always get an empty file (without any warnings or errors):

$ pdf2ps PDF/Report_a_bug_about_Ubuntu.pdf > test.ps
$ ls -l test.ps
-rw-r--r-- 1 stefan stefan 0 2008-06-20 08:05 test.ps

I am using the latest version of ghostscript with Ubuntu 8.04:

$ apt-cache showpkg ghostscript
Package: ghostscript
Versions:
8.61.dfsg.1-1ubuntu3 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_hardy_main_binary-i386_Packages) (/var/lib/dpkg/status)
 Description Language:
                 File: /var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_hardy_main_binary-i386_Packages
                  MD5: 31ed2cadf85fcf9af30eb3ce9265a328
[...]

Revision history for this message
JM Williams (jmdwilliams) wrote :

I think you will find the file ~/Report_a_bug_about_Ubuntu.ps containing the output you wanted.

pdf2ps’s man page gives usage as:

    pdf2ps [ options ] input.pdf [output.ps]

What it doesn’t mention is that if output.ps is not specified, input.ps will be automatically created in the current directory. If you want to use standard output, you need to specify “-”.

So, a couple of rephrasings that would work are:

    pdf2ps PDF/Report_a_bug_about_Ubuntu.pdf test.ps
    pdf2ps PDF/Report_a_bug_about_Ubuntu.pdf - > test.ps

I am marking this bug as Invalid because “the report describes the software’s normal behaviour” (https://help.launchpad.net/BugStatuses). Of course, please revert the status if I have misdiagnosed the symptom.

However, I agree that the usage of pdf2ps and the other ghostscript programs is confusing, and would like it to be standardised, so if you want to create a feature specification or similar, I for one would second it!

Changed in ghostscript:
status: New → Invalid
Revision history for this message
StefanS42376868 (stefans42376868) wrote :

Thanks a lot, that does it!

But as you mentioned, the documentation is misleading. Of course I had read "man pdf2ps" before I submitted the problem report, but I expected that a missing output argument would automatically be substituted by stdout.
Maybe you can add a hint in the man page?

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

StefanS42376868, if you want the usage of Ghostscript tools getting standardized and the man pages improved, feel free to report an upstream bug/feature request on http://bugs.ghostscript.com/.

Revision history for this message
JM Williams (jmdwilliams) wrote :

I see the non-standard behaviour of the ghostscript tools as quite troublesome, because they are likely to be used in conjunction with tools such as those provided by psutils, which behave as standard Unix text processing utilities. This can lead to awkward pipelines such as the following, which is given in two equivalent forms, and which rearranges the pages of a document to produce a booklet for double-sided printing:

    pdf2ps example.pdf - | psbook | psnup -n 2 | ps2pdf - example-booklet.pdf
    pdf2ps - - < example.pdf | psbook | psnup -n 2 | ps2pdf - - > example-booklet.pdf

The first form is shorter, but the second requires less rewriting when one adds or removes sections at the ends of the pipeline.

Altering the way that the ghostscript tools deal with command-line arguments may be desirable, but it is not a trivial change, because it may break existing scripts, and only trivial changes should be Wishlist items in Launchpad (see https://wiki.ubuntu.com/Bugs/Importance). Making the tools just slightly more verbose might be considered trivial, but it would still be better done upstream. The tools could specify the output file, in a similar manner to wget, when they have created the filename implicitly. For example:

    Output: Report_a_bug_about_Ubuntu.ps

As it happens, the tools such as pdf2ps are shell-script wrappers around an executable, and so are easily tweaked. An example patch for pdf2ps is attached.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.