Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cropping PDF using BoundingBox/CropBox in Postscript

I would like to know what the actual difference between BoundingBox and CropBox in a Postscript file is. I want to crop a PDF file and display only the cropped part of it as another PDF file. I converted the PDF file to postscript using pdftops from the xpdf library. I plan to edit the BoundingBox/CropBox parameters so that only a particular part of the original file is displayed. But when I open the file I still see the original file. Which parameter should I change to crop a PDF?

like image 537
user1512781 Avatar asked Mar 05 '26 00:03

user1512781


1 Answers

PostScript doesn't have a BoundingBox or CropBox at all, just the media request which is equivalent to the MediaBox in a PDF file. (you could convert the CropBox to a page level clip which would have a similar effect)

Its not obvious to me what you are trying to do, if you want a PDF file with a modified CropBox then you just alter the CropBox in the PDF file, I can't see why you are converting to PostScript.

If you want a cropped area from the original file, copy it and alter the CropBox in the copied file.

like image 171
KenS Avatar answered Mar 08 '26 09:03

KenS



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!