RSS Feed

Comments RSS

a neat trick via Ghostscript

I have found a neat trick.  Not original, found it here:

PostScript and PDF

  • To concatenate PostScript or PDF files into a single PDF file:

    gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
    -sOutputFile=<outfile> <infile> <infile> …

  • To concatenate PostScript or PDF files into a single PostScript file:

    gs -q -dNOPAUSE -dBATCH -sDEVICE=pswrite \
    -sOutputFile=<outfile> <infile> <infile> …

  • This trick used in combination with the fact that in Ubuntu you can print not only to a printer, but also to either a postscript or PDF file directly, means that if a book is presented in html on the web, say with each chapter being an individual HTML page, you can easily print each of these to a file and then use the trick to concatenate the ps or pdf files together to reassemble the entire book.  For instance, I am doing that with this book that is online:

    I do not know how many other books that I have run across on the web that were HTML like this and I wanted to reassemble them for a good print out.  This is a way to do it.

    By the way, “gs” is the command line program for Ghostscript, which should be already installed on your Ubuntu system by default.  If you install Ghostscript on a Window system, the same trick should work there too so long as you print the HTML to a PDF printer driver.  Ghostscript can be downloaded from here:

    Oh, yes, this is also cool…: