Strange problem, but I'll do my best to explain it.

What I'm needing to do, is take pages from an existing pdf, and stitch them
into a pdf that I'm generating. This is working fine, and I have no problem
with it, but the pdf that gets stitched in (or rather certain pages of it)
has a quirk which is causing problems.

It's MediaBox is set to 27,27,639,819 (so 8.5x11, but shifted 27 point up
and right). It has no CropBox defined. The reason it's like this, is that
this pdf (from what I'm led to understand, it's created by a third party, so
I can't do anything about it) is itself stitched together from other pdfs,
and certain pages of it come from source pdfs that are oversized.

Normally, this isn't a problem, as the mediabox is set correctly to the part
of the pdf that needs to be viewable, and the resultant pdf (after I've
stitched things together) looks fine in readers. The problem is that these
get sent to a printer (as in a printing company), in a batch (several pdfs
generated the same way), and the printer does something to them that changes
the cropbox and ends up screwing up the way it comes out.

I've checked the raw pdfs in a text editor, and the media/crop boxes for the
bad pages are as follows :
What I get from the third party : media[27,27,639,819], no cropbox defined
What I generated (after stitching it in) : media[27,27,639,819],
crop[0,0,612,792]
The pdf coming out of whatever the printer is doing : media[27,27,639,819],
crop[27,27,639,819]

The result of this is that the bottom and left edges of these pdfs are
getting cut off.

I've tried playing around with changing the media/crop boxes, but with no
success, I just end up generating pdfs that have edges cut off or have extra
edges that we don't need.

What i'd like to know, is if there's some way of shifting all the content of
the page down and left by 27 points (then I could just adjust the media box,
and still end up showing the correct content), or if there's some way of
copying the content within the mediabox of these pages onto a new page (and
in so doing, resetting the mediabox coordinates to be 0-based).

Thanks
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a 
definitive record of customers, application performance, security 
threats, fraudulent activity and more. Splunk takes this data and makes 
sense of it. Business sense. IT sense. Common sense.. 
http://p.sf.net/sfu/splunk-d2d-c1
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to