Linux Geek‎ > ‎

Merging PDF files

posted Oct 24, 2009 12:38 AM by Bruno Braga   [ updated Oct 24, 2009 12:54 AM ]
I was looking at the Linux Kernel in a Nutshell, written by Greg Kroah, and found that the PDF version of the book was all splitted in small files by chapter. I just wanted to wrap them all up into a single file (obvious reasons), so I started looking for solutions on PDF merging. This one here (by lobner) was pretty suitable for me (from the extracted directory containing all files):

gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=LinuxInNutshell.pdf title.pdf ch00.pdf part1.pdf ch01.pdf ch02.pdf ch03.pdf ch04.pdf ch05.pdf ch06.pdf part2.pdf ch07.pdf ch08.pdf part3.pdf ch09.pdf ch10.pdf ch11.pdf part4.pdf appa.pdf appb.pdf LKNSIX.fm.pdf

This command (uses GhostScript) gives me some warnings, but since the output file is OK, I didn't even run to the trouble of torubleshooting it...

   **** Warning: File has a corrupted %%EOF marker, or garbage after %%EOF.

   **** This file had errors that were repaired or ignored.
   **** The file was produced by:
   **** >>>> Acrobat Distiller 4.05 for Sparc Solaris <<<<
   **** Please notify the author of the software that produced this
   **** file that it does not conform to Adobe's published PDF
   **** specification.

[...] (this goes multiples times, once per file)

By the way, thanks Greg by the book! I promise I'll read it before annoying you with compiling issues and stuff!

 BRAGA, Bruno

 



Brazilian currently based in Japan, working on Information Technology.