in reply to Re: Shrink PDF
in thread Shrink PDF

Aha, may be I should have mentioned more clearly in the first place.
I mean by Shrink: As if you are copying on a nice copier which can reduce the size of the page. If the Page size is reduced, I can use PDF::API2 to create an new page and add header and the shrinked page to it.

Replies are listed 'Best First'.
Re^3: Shrink PDF
by dragonchild (Archbishop) on Aug 24, 2004 at 19:03 UTC
    Ahhh ... you mean to resize the page. Yeah - that's really easy ....... well, kinda.

    The PDF format stores the size of the page (in points), as well as where each item on the page is relative to some origin point (usually the top left corner).1 So, you would have to change the page size. This part is easy. The hard part is changing the location of each item, as well as the size of each item, by the same ratio. This would be a very CPU-intensive process. But, it could be done.

    I would recommend looking at PDF::Reuse and seeing if you can jimmy it to do what you want. I haven't looked under its hood, but it reads the PDF file and allows you to make changes, so it shouldn't be too hard.

    1. Well, not exactly, but it boils down to that.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

    I shouldn't have to say this, but any code, unless otherwise stated, is untested