views:

51

answers:

3

Hi there,

I have a postscript file of a poster made in latex, and want to convert this to a pdf (I'm using ubuntu)

I am using ps2pdf but if possible I would like to remove the first, blank page, and keep only the second page.

Is there a command that allows this? Been trying to find one for longer than would seem sensible!

Thanks!

A: 

You could use the Pdftk command line tool as a second process using the 'cat' option to only write out page 2.

http://www.pdflabs.com/docs/pdftk-man-page/

Andrew Cash
A: 

First convert to PDF the complete file with whatever tool you prefer. (For quality output I would not use ps2pdf which is only a shortcut to run a fully fledged Ghostscript commandline. I would use the appropriate Ghostscript commandline directly, because it gives greater and direct control over all the parameters used. But it needs some GS expertise to use...).

Then, to extract the second page only, you have two options:

  1. pdftk (PDF ToolKit from here)
  2. gs (Ghostscript from here)

pdftk commandline:

pdftk \
  A=/path/to/input.pdf \
  cat A2 \
  output /path/to/page2-from-input.pdf

gs commandline:

gs \
  -o /path/to/input.pdf \
  -sDEVICE=pdfwrite \
  -dFirstPage=2 \
  -dLastPage=2 \
  /path/to/output.pdf
pipitas
Thanks very much to both of you for your responses!
anthr
@anthr: are you aware that you can "upvote"/"downvote" useful/false answers by clicking on the up/down arrows at the top left of each answer?
pipitas
Hi pipitas, I did try, but you need a reputation of 15 in order to do this.. almost there!
anthr
A: 

Several Linux distributions have psselect which does this. I guess it's from the psutils package.

lhf
@lhf: psselect doesn't work reliably for all sorts of PostScript input. If it does, it's great though ;-)
pipitas