[pdftex] Cropping bottom margin off one-page documents.
Jean-Christophe Dubacq
jean-christophe.dubacq at ens-lyon.org
Wed Sep 22 09:38:24 CEST 2004
On Wed, Sep 22, 2004 at 07:02:13AM +0000, Michael Chapman wrote:
>
> My thanks to Sebastian Rahtz, Hans Hagen, Heiko Oberdiek, Pawel, Reinhard
> Kotucha and Jean-Christophe Dubacq.
>
>
> Editing the PDF files by changing the /MediaBox line works fine,
> but as at least two people said "caution, do not change the number of bytes"
> in the PDF file. (I'd forgotten and relearnt the hard way.)
> That creates a problem as two of the /MediaBox parameters are zero's and need
> (typically) changing to three and four figure numbers.
> Suspect I could get around that by having some gratuitous material in one of
> the PDF Document Information Fields and then compensating by deleting the
> right number of bytes from there.
Include a comment or play on spaces. Sample:
90 0 obj <<
/Type /Page
/Contents 95 0 R
/Resources 94 0 R
/MediaBox [0 0 595.276 841.89]
/Parent 122 0 R
/Annots [ 104 0 R 108 0 R 109 0 R 110 0 R ]
>> endobj
This is one object taken from one of my pdfTeX documents.
If I need a few chars, I could delete as many spaces as necessary (or
newlines) as the PdF lexer allows me to. Shortest valid expression (if I
recall correctly):
90 0 obj<</Type/Page/Contents 95 0 R/Resources 94 0
R/MediaBox[0 0 595.276 841.89]/Parent 122 0 R/Annots [104 0
R 108 0 R 109 0 R 110 0 R]>>endobj
I think I gained a dozen bytes.
--
JCD
More information about the pdftex
mailing list