PDFTK can be used to easily merge or stitch or combine together multiple PDF files into a single PDF file.
pdftk *.pdf cat output out.pdf pdftk 1.pdf 2.pdf 3.pdf cat output out.pdf
Tried with: PDFTK 1.41
PDFTK can be used to easily merge or stitch or combine together multiple PDF files into a single PDF file.
pdftk *.pdf cat output out.pdf pdftk 1.pdf 2.pdf 3.pdf cat output out.pdf
Tried with: PDFTK 1.41
Some vector tools can export figures only to the PDF format. If you need the figures in the EPS format, then one possible option for the PDF-to-EPS conversion is pdftops. This tool ships with the Xpdf package.
To convert a PDF to EPS use the -eps parameter:
$ pdftops -eps Foo.pdf
Xpdf can be downloaded separately (here) or as a part of the GNUWin32 universe (here).
Tried with: XPDF 2.03
Problem
Sometimes you may want to extract certain pages of a PDF file and save those pages as a separate PDF file.
Solution
This is easy to do with Adobe Acrobat. Open the PDF file in Acrobat and choose Document → Extract Pages. In the Extract Pages dialog, choose the pages you wish to extract and press OK. A new instance of Acrobat opens with the pages you specified. Choose File → Save to save these pages as a new PDF File.
Tried with: Adobe Acrobat 8
Sumatra PDF is a lightweight PDF reader for Windows. Compared to Acrobat Reader and even Foxit Reader, Sumatra is simpler in its UI and faster to open. One of the coolest features is that when you open a PDF that you had opened before, it goes directly to the page and zoom level which you were at when you had closed it! I highly recommend Sumatra PDF as the primary PDF reader on Windows.
Tried with: Sumatra PDF 1.5.1
Problem
The dvipdfm program is used to convert a DVI file to a PDF file. For a DVI file which has EPS image files inside, this conversion might sometimes fail with the error shown below:
C:\Users\joe>dvipdfm foo.dvi foo.dvi -> foo.pdf [1 ** WARNING ** Image width=0.0! ** WARNING ** Image height=0.0! ** WARNING ** Transformation matrix not invertible. ** WARNING ** --- M = [0 0 0 0 233.624 -249.417] ]
Solution
This error indicates that one or more of the EPS image files included in the DVI file have no width and height information. This is typically caused by EPS files whose BoundingBox parameters are all zero. You can check this by opening the EPS file in a text editor and look for a line that resembles this:
%%BoundingBox: 0 0 0 0
If you can generate EPS files that have non-zero bounding box values, this conversion error should be gone. For a quick hack to fix an existing EPS file with these values see here.
Tried with: MiKTeX 2.9
Problem: Some PDF documents are configured only to be viewed, but not printed. When such a document is opened in a PDF viewer like Adobe Reader, the Print option is completely disabled.
Solution: To print such a PDF document, open it up in GSView (viewer for PostScript documents) and print from it.
Problem
I tried to convert a PDF file to a JPG image using convert.exe from ImageMagick and got the following error:
$ convert Foobar.pdf Foobar.jpg convert: `%s' (%d) "gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraph icsAlphaBits=4 "-r72x72" "-sOutputFile=C:/Users/Joe/AppData/Local/Temp/magick-p1m2jxT1" "-fC:/Users/Joe/AppData/Local/Temp/magick-tf9Qz_d_" "-fC:/Users/Joe/AppData/Local/Temp/magick-sa 5AGTv3" @ error/utility.c/SystemCommand/2093. convert: Postscript delegate failed `Foobar.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/645. convert: missing an image filename `Foobar.jpg' @ error/convert.c/ConvertImageCommand/2970.
Solution
It looks like the input or output filenames are missing or have some problem. Look closer and it is an error caused by gswin32c.exe. ImageMagick uses gswin32c.exe from the Ghostscript package to convert PDF files. So, to fix this error make sure that:
gswin32c.exe is in the PATH environment variable.Ensure that PDFTK is installed and the directory of pdftk.exe is in the %PATH% environment variable.
To split a PDF file into multiple PDF files, one per page of the original PDF file, invoke:
$ pdftk foobar.pdf burst output foobar-%d.pdf
If foobar.pdf is a 2 page PDF, this splits it into foobar-1.pdf and foobar-2.pdf.
It would be much nicer to invoke the above simply as:
$ splitpdf foobar
To be able to do that, turn the above invocation into a batch file:
REM splitpdf.bat pdftk %1.pdf burst output %1-%%d.pdf
The %1 is the first input argument to the batch file invocation. And %% is the way to escape %, which is a special character in a batch file.
(via Beamer + Ipe + views)
The convert command-line tool from ImageMagick is the easiest way I know to convert a bunch of images into a single PDF document. It is as easy as:
convert *.jpg paper.pdf
(Make sure the ImageMagick installation path is in your %PATH% environment variable for this to work from any directory.)
I typically use this to convert the scans of old CS papers. Even today there is a surprisingly large amount of old CS papers that are not available online in a digital format. The only option is to head down to the library, get hold of the journal and either photocopy or scan the pages. I always prefer to scan in the paper as JPG images, then straighten and edit the images a bit in Picasa and then convert it into a PDF document.