As far as I understand, you say that there is a PdfPage::SetCropBox() method
in the PoDoFo API but it hasn't been included in the documentation yet.
Thank you, that helps a lot. I was wondering if you (or anyone else) would
be able to answer other questions from my previous e-mail. I.e. the
following:
I also found PdfPage::GetTrimBox() and PdfPage::GetMediaBox(). The former
mentions the "cut area" while the latter claims to deal with the physical
page size. Could I achieve the cropping effect (and get rid of all the
unnecessary (i.e. invisible) stuff) by just by changing the physical page
size? Or perhaps first changing the CropBox and then the MediaBox? And
what can the cut area in GetTrimBox() be used for if not for cutting a
rectangular area of a PDF page and then copying it somewhere else (or does
it just cut the text or bitmap representation)?
Any insights greatly appreciated.
Cheers,
T
On 18 February 2011 00:01, Leonard Rosenthol <lrose...@adobe.com> wrote:
> Just add a SetCropBox() method to the API – it’s a single line call (just
> setting the value of a key in a dictionary).
>
>
>
> Leonard
>
>
>
> *From:* tomasz.kota...@gmail.com [mailto:tomasz.kota...@gmail.com] *On
> Behalf Of *Tomasz J. Kotarba
> *Sent:* Thursday, February 17, 2011 2:51 PM
>
> *To:* Leonard Rosenthol
> *Cc:* podofo-us...@lists.sf.net
> *Subject:* Re: [Podofo-users] It is possible to crop a page
>
>
>
> Leonard,
>
> Thanks for such a quick answer. What is the preferred way of setting the
> CropBox of the page? I could not find a setter method - only a getter
> PdfPage::GetCropBox(). Incidentally, I also found PdfPage::GetTrimBox() and
> PdfPage::GetMediaBox(). The former mentions the "cut area" while the latter
> claims to deal with the physical page size. Could I achieve the cropping
> effect (and get rid of all the unnecessary (i.e. invisible) stuff) by just
> by changing the physical page size? Or perhaps first changing the CropBox
> and then the MediaBox? And what can the cut area in GetTrimBox() be used
> for?
>
> Cheers,
>
> T
>
>
>
> On 17 February 2011 21:56, Leonard Rosenthol <lrose...@adobe.com> wrote:
>
> Simply changing the visible area of the page is trivial to do with PoDoFo –
> just set the CropBox of the page. However, that won’t remove anything
> physically from the file, it will simply hide it from the user.
>
>
>
> To actually remove content is possible with PoDoFo, but will require very
> low level APIs and a DEEP understanding of PDF. Also, while it would work,
> it would NOT meet your requirement to “leave an EXACT COPY of the objects”.
> Certainly, the visible appearance would remain, but the objects that put
> that on the page wouldn’t necessary be exact copies. (I am splitting hairs
> at technical level….)
>
>
>
> Leonard
>
>
>
> *From:* tomasz.kota...@gmail.com [mailto:tomasz.kota...@gmail.com] *On
> Behalf Of *Tomasz J. Kotarba
> *Sent:* Thursday, February 17, 2011 8:05 AM
> *To:* Leonard Rosenthol
> *Cc:* podofo-us...@lists.sf.net
> *Subject:* Re: [Podofo-users] It is possible to crop a page
>
>
>
> Hi Leonard,
>
> Thanks for your trying to help. To answer your question - if no part of
> any of the images has been selected (i.e. as you say - only the text) then,
> ideally, I would like them not to be present in the excerpt like in this
> example from some random web page:
> http://www.mediacollege.com/adobe/photoshop/tool/crop.html (unfortunately
> it only shows an image, not a document with both text and figures). Why do
> you ask? Does it mean that it is not possible to copy a rectangular region
> of a page and save it as a new PDF with PoDoFo but there is a function which
> can hide everything apart from the selected region? If so, then would it
> left blank empty space around the region or would the new page be scaled
> down?
>
> Cheers,
>
> T
>
>
>
> On 17 February 2011 14:26, Leonard Rosenthol <lrose...@adobe.com> wrote:
>
> Before I answer, can you clarify something?
>
>
>
>
> Let say that you have a page with 2 images and some text. If I select only
> the text, then when writing out the new PDF, would you expect that the
> images wouldn’t be present and taking up space? OR do you simply want them
> not to render/draw?
>
>
>
> Leonard
>
>
>
> *From:* Tomasz J. Kotarba [mailto:tom...@kotarba.net]
> *Sent:* Wednesday, February 16, 2011 2:47 PM
> *To:* podofo-us...@lists.sf.net
> *Subject:* [Podofo-users] It is possible to crop a page
>
>
>
> Hi,
>
> I was wondering if PoDoFo can be used to select a rectangular area of a
> page and save it as a separate PDF document representing an exact copy of
> the selected page region? An exact copy is not just a string of characters
> or a bitmap (many libraries can do that) - it has to maintain all the
> information present in the original (i.e. it should both be the exact copy
> of the internal PDF tree-like structure of objects (which would allow for
> further processing with PoDoFo or other PDF processing tools ) and look
> identical to the original when viewed in a PDF viewer). Is there a function
> which does this?
>
> Cheers,
>
> T
>
>
>
>
>
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users