On Wed, Mar 02, 2011 at 04:50:17PM -0500, Eric Doviak wrote: > Hi Michal, Jozef and Martin,
Hi, > > For a very long time, I have wanted a program that would > automatically resize and rescale a PDF page so that it fits on a > standard-size sheet of paper. After many bad hacks and after > receiving a lot of help, I have gotten closer to my dream. > > The attached script: > > * determines the page orientation > * calculates the optimal page metrics and scale factor and > * resizes and rescales the pages. > > For most purposes, this script will do what I need it to do -- fit > the text of an journal article onto a standard size sheet of paper. Nice > > But occasionally, I receive a PDF file with enormous white margins. > In such cases, I want to crop the pages down to the bounding box > before resizing and rescaling the page. Maybe just a terminology but what do you mean by the bounding box? I guess what you actually mean is the media size (aka paper size). You will get this value by page_dict.property( "MediaBox" ) and you can change it by modifying the given rectangle. Btw. do you want this to be automatical? (determine the text area and crop down to this size + border). This would be really interesting but then you would need to go through all text and graphical operators on the page and call getBBox on them and calculate the area from them. > > So I would like to include the bounding box values in my script. I > know that there is a "getBBox()" function, but I cannot get it to > work. getBBox is IIRC a operator function which returns its bounding box -- Michal Hocko ------------------------------------------------------------------------------ What You Don't Know About Data Connectivity CAN Hurt You This paper provides an overview of data connectivity, details its effect on application quality, and explores various alternative solutions. http://p.sf.net/sfu/progress-d2d _______________________________________________ Pdfedit-support mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pdfedit-support
