[ale] A PDF Challenge
Joe Steele
joe at madewell.com
Thu Sep 28 14:19:02 EDT 2000
Jeff Hubbs wrote:
>
> Here's the challenge I've been given: Take a PDF-format brochure that is
> formatted for folding and stapling down the middle (original is landscape)
> and produce a new PDF file with one brochure page per printed page.
<snip>
> I need a way to pull this off under Linux. I have ps2pdf and xpdf, so on
> the surface of it, it seems like I need to use xpdf to print to a Postscript
> file (there's got to be a way to do that but I have yet to find it),
You can use xpdf to generate PS, but I generally prefer using pdf2ps which
comes with ghostscript (and which is really just a short shell script for
invoking gs).
> manipulate the PS somehow,
That's where the fun begins. What you want to do is within the
capabilities of PS; it's just a little matter of writing the script to do
it -- rotate the axes...enlarge the scale...reposition the origin...set
up a clipping area to hide unwanted marks...generate the page as
normal...then repeat for each page, saving the output as a PS file.
Needing to generate two pages from one page complicates the matter --
probably handled with two passes through the file, each pass processing
only one of the two images on the page. Needing to get the pages in order
complicates the matter further -- possibly handled with additional passes
through the file until all pages are output in order.
> and then use ps2pdf to go back to PDF.
Yup. Or if the processing is all handled by running a single script, the
output could be written directly as PDF. That would be pretty impressive.
> Any suggestions on how to proceed or what to use, or is this something that
> would better be done entirely in Acrobat?
Beyond my generalities, I don't have much of anything useful to suggest. The
process I've described is not exactly trivial, at least for a person of my
skills. I've "learned" postscript enough to know what it can do, but I don't
use it enough to where I can easily write scripts that work as intended
without major debugging time. (Debugging was especially frustrating when I
was first experimenting with PS because my only way to see results was to
print a page on a PS printer. No telling how many forests were sacrificed.
Oh well, at least I wasn't writing the scripts on punch cards.)
I don't have anything to offer for alternatives, either. You mention Acrobat,
which I've never used. Of course, you could convert the pages to raster
images and then cut them up, enlarge them, and convert them to PDF again, but
that would seem rather crude.
--Joe
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
More information about the Ale
mailing list