Hi,
I'm copying pages from one document into another. My script can take a A3 pdf and scale it down to a A4 by using the following: iTextSharp.text.pdf.PdfReader reader = new iTextSharp.text.pdf.PdfReader(inPDF); iTextSharp.text.pdf.PdfWriter writer = iTextSharp.text.pdf.PdfWriter.GetInstance(pdfDoc, new FileStream(outPDF, FileMode.Create)); for (int i = 1; i <= reader.NumberOfPages; i++) { iTextSharp.text.pdf.PdfImportedPage oriPage = writer.GetImportedPage(reader, i); image = iTextSharp.text.Image.GetInstance(oriPage); image.ScaleToFit(iTextSharp.text.PageSize.A4.Width, iTextSharp.text.PageSize.A4.Height); image.SetAbsolutePosition(0, 0); image.Border = iTextSharp.text.Rectangle.BOX; image.BorderColor = iTextSharp.text.BaseColor.GREEN; image.BorderWidth = 1f; directcontent.AddImage(image); pdfDoc.NewPage(); } This is works great on most of my pdfs. However there are some pdf's where I want to only use the content within the cropbox. When I use the above script it done not use the crop box for the size, therefore any trim marking and anything else outside the cropbox are shown. I've been trying for hours now to try and get it to use the dimensions of the cropbox. After a lot of digging around I thought I had found a solution: In the itextsharp source file "itextsharp-5.0.0\iTextSharp\text\pdf\PdfImportedPage.cs" and in the class " PdfImportedPage" I changed: "bBox = readerInstance.Reader.GetPageSize(pageNumber)" To "bBox = readerInstance.Reader.GetCropBox(pageNumber);" Thinking this would work, but it does not see too. I think I'm starting to go round in circles now. Does anyone have any suggestions? Many thanks Ric
------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php 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/