In the midnight hour, sometimes Linux can be your best friend. I learned a useful piece of software that actually comes standard in a Linux setup, and met my deadline without anyone being the wiser to boot.
The task was simple, extract a page from one pdf, then combine the pages of multiple pdfs into one package for a scholarship submission. Adobe Acrobat X accomplishes this with ease, and I assumed I had a functioning copy at home. Of course, this was not the case. I’m embarassed to say that even with 4 computers at home, no Adobe Pro was to be found. Granted, two of said computers are 10 year old Dell D-series and one is a desktop from the early 2000s, so really I only had myself to blame. To make matters worse, somewhere along the way I’d used up my download option from the university Software Center.
What to do?
My dilemma was solved with a free software package called Ghostscript. It is already availible in Linux, and works by rendering or conversion of PostScript or PDF files.
The command to extract pages from a PDF file with GhostScript looks scary, but does the job beautifully:
gs starts the program and -dFirstPage and -dLastPage instruct Ghostscript where to extract the page. Then -sDEVICE=pdfwrite tells Ghostscript to render the files, and finally -sOutputFile= produces the final extracted page. If you include -q then you don’t get any messages while the program is in action. This is a useful input, because without it you get a whole chunk of script about Copyright, Warranty, and other boring information.
With the extraction process complete, now comes the grand finale.
In this script, -dBATCH and -dNOPAUSE instruct Ghostscript to do its job quickly and quietly then stop. You are left with a perfect -sOutputFile that needs no further tinkering.
I’m almost glad this error happened to me because I got to learn about Ghostscript. ….Almost.