Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Ê×Ò³>>Unix&Linux>>Working w/PDFs Via the Command Line

Working w/PDFs Via the Command Line

chartpacs
02-08-2006, 01:05 AM
Hello,

Could anyone point me to some command-line utilities (preferably cross-platform) that can deal with PDFs? I'm looking to do basic tasks like merging PDFs, rotating PDFs, getting info like page count, maybe extracting the first page as converting it to a JPG (for previews).

Regards,
Sean

dmacks
02-08-2006, 02:03 AM
"pdfjoin", part of the PDFjam (http://www.warwick.ac.uk/go/pdfjam) utilities, sounds useful.

pmccann
02-09-2006, 07:47 AM
If you do have TeX lots of pdf-related tasks are really easy. (If you don't there's now an all-in-one mega-installer called "mactex" that looks like a great idea: just press *go*, instead of the fairly laborious i-Installer based routine that you used to have to endure. See

http://www.tug.org/mactex/

and not that I'm not joking about "mega".) Anyway, given that...

To simply concatenate a bunch of pdf files /tout court/ you can use a one-liner...

% texexec --pdfarrange --result all.pdf file*.pdf

(or even using ghostscript

% gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf *.pdf

)

If you want more control over importing certain pages you can use the pdfpages package in latex; just run the following through latex:


\documentclass[letter]{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages=5]{me.pdf}
\includepdf[pages={12-14}]{you.pdf}
\includepdf[pages=4-8,12-14]{dog.pdf}
\includepdf[pages=1-]{boo.pdf}
\end{document}

That'll give you the obvious pages from the four pdf files: page 5 only from me.pdf, pages 12-14 from you.pdf, pages 4-8 and 12-14 from dog.pdf and all pages from boo.pdf.

pdfpages can handle rotations as well, and Graphic Converter (for example) can turn the first page of a pdf into a jpg without even raising a sweat: so, I'm sure, can lots of other apps.

Cheers,
Paul


 

TOP

Windows Server Outsell
Unix Signals And C++ E

For more info

Unix Signals And C++ E
Windows Server Outsell
bash not using my .bas
Applescript: Hide Proc
help with installing p
Mozilla install from d
ssh - don't want to us
Escaping quotes in Tig
Terminal Keybindings 
JAVA help, please! 

News Archive

Displaying Images on t
Install Office from th
Terminal Problem...? 
cc1plus not executable
desktop icons.. 
at & growlnotify 
unknown terminal type 
scp arbitrary files 
What and why is a 'Dis
permissions already me

Related stories:

softlinks?
library problem in gfortran
gtk2 build problem
My shell scripts won't run in OS X!

Copyright@2004-2005 www.zzcoke.com All Right Reserved

link:Citenna