Hi i am trying to set a trim box using iText 2.0.4 but it is just not
working. here is my code

------------------------------------------------------------------------------------------------------

                PdfReader reader = new PdfReader(inputStream);
                
                Rectangle size = reader.getPageSize(1);
                cropSize = scaleSize(cropSize);
                Rectangle trimBox = new Rectangle(size.getLeft() + cropSize,
size.getBottom() + cropSize, size.getRight() - cropSize, size.getTop() -
cropSize);
                
                System.err.println("CROPSIZE :" + cropSize);
                System.err.println("Trim Box left:" + trimBox.getLeft());
                System.err.println("Trim Box Bottom:" + trimBox.getBottom());
                System.err.println("Trim Box tight:" + trimBox.getRight());
                System.err.println("Trim Box top:" + trimBox.getTop());
                
                Document document = new 
Document(reader.getPageSizeWithRotation(1));
                PdfCopy copy = new PdfCopy(document, outputStream);

                copy.setPDFXConformance(copy.PDFX1A2001);
                copy.setCropBoxSize(new Rectangle(5, 5, 427, 787));
                copy.setBoxSize("trimbox", trimBox);
                copy.setBoxSize("artbox", trimBox);

                document.open();
                copy.setOutputIntents("FOGRA39", "Offset commercial and 
specialty printing
according to ISO 12647-2:2004 / Amd 1, paper type 1 or 2 (gloss or matte
coated offset, 115 g/m2), screen frequency 60/cm.", "http://www.color.org";,
"ISO Coated v2 (ECI)", iccProfile);
                for (int i = 1; i <= reader.getNumberOfPages(); i++)
                        copy.addPage(copy.getImportedPage(reader, i));
                document.close();
                copy.close();
                reader.close();
                inputStream.close();
                outputStream.close();

------------------------------------------------------------------------------------------------------

i have tried            copy.setBoxSize("trim", trimBox); and   
copy.setTrimBoxSize(trimBox);

and before anyone says buy the Itext in action book i have and i have read
it but still i have this issue. 

I dont know whether the PDFcopy class is not inheriting properly from the
PDFwriter. it would be good if someone code give my code a look. It does not
throw and errors and the trim box sizes are correct... Cheers for any help
you can give me.

-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Trim-box-problem-tp2272123p2272123.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to