This may just be a vocabulary question - not knowing which family of calls to use. I have a large 36"x24" architectural file with 70 layers. I wish to create a new file which is a rectangular area of that page with a certain selection of layers. At this point, I can successfully use the CropBox and OptionalContentGroup functions to do this particular job, but the resulting file would be the original file with a few things set to limit the display. The destination file would be virtually identical in size to the original, and actually contain the entirety of the original file, just much of it masked off.
"Rendering" lets me extract that rectangular area to many types of image files/streams, but "PDF" is not a destination type. "Rendering" is pretty much taking a snapshot picture of a page, or portion of a page.
Can anyone point me to a function area that goes in the direction I'm describing? -- pdf to smaller pdf? (but, not by rendering to an image of the page).
If I use "DeleteOptionalContentGroup", will it completely remove all traces of that content group from the resulting file? So, will "loadfromfile"/"selectpage"/"DeleteOptionalContentGroup"/"savetofile", result in a smaller file? with all of the other content groups undisturbed? (I know I could try this, but I'm getting tired of trial-and-error as a substitute for documentation). To rephrase the question - Will using "DeleteOptionalContentGroup" on all content groups except one produce a file that just contains that one optional content group (plus fonts and other normal overhead)?
Is there a comparable "crop" operation that will remove internal pdf commands that don't produce any effects within the crop rectangle? In order to do what I visualize, a line passing through the rectangle would have to be shortened by setting the endpoints to the places where it crosses the rectangle. I suspect that this is not possible (or at least is not an existing QuickPDF function). My gut says that it would be extremely hard to apply command-by-command cropping.
My gut says that "rendering" to a CropBox is actually the rendering of the entire page to a canvas and then cropping the result. My best evidence for this is that it takes nearly as long to render a 1"x1" square of the page as it does to render the entire page. This is what I was doing in my own code before I discovered the CropBox (and I still do this to avoid the 3/4 second render of the 36x24 page every time I want to move around in the page image - the 1"x1" extraction from a bitmap takes virtually zero time).
Anyway, I'm just looking for suggestions or areas to explore.
Thanks - Howard
|