[pdftex] Cropping bottom margin off one-page documents.

Michael Chapman pdftex at mchapman.com
Wed Sep 22 09:02:13 CEST 2004


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.

Pawel said:
"while embedding pdf page as an image"
	Would that lose the hyperlinks (pdfpages, gs, do)?
	(Sorry I'm a simple Latex man so I'd need to do some head scratching to use 
this method.)
"Are all these pages to be cropped in the same way"
	Yes, in that I just chop the white space off the bottom (and add back a 
small margin). No in that they are all different lengths.


I find producing cropped (or cropped plus margin) PDFs increasingly useful. 
Without hyperlinks it is quite easy, but it would be nice if it was just a 
direct option without running 'pdfcrop' afterwards.

A fast (and I suspect dirty) use was a parallel translation Arabic:Chinese. 
Both inputs were in UTF-8. 'ucs' and 'arabtex' seemed to be fighting over 
encodings, so I just produced all my paragraphs as individual PDF images. 
Presto!

Thanks again for all the wisdom,

	Michael Chapman


Correction:
If anyone tries the script in my message of  Mon, 20 Sep 2004 03:58:36 +0000
	system( "mv temp-files/tmp.pdf /new_pdf/$filename" );
should have read
	system( "mv temp-files/crop.pdf /new_pdf/$filename" );



More information about the pdftex mailing list