Hi everyone, this is my first question.

I'm sorry but I've to skip presentation 'cause I'm pressed ...

 

The problem I have is the following: I'm trying to manipulate PDF files
(ex. Adding images, adding barcodes etc.).

Usually I don't have big problems but in this case ...

 

When I read the document page size via code 

                        reader = new PdfReader(lOriginalFileName);

                        r = reader.GetPageSizeWithRotation(1);

I read a size corresponding to an A4.

The problem arises because when I read the page size in File -
Properties within Adobe Reader I see 177.8 mm x 228.6 that looks like a
custom size.

What happens is that when I append a barcode based on page size it's
attached outside the page ...

 

I tried to "save as" the original document using, for example, this code

                        Document doc = new Document(new
iTextSharp.text.Rectangle(A4POINTSWIDTH, A4POINTSHEIGHT), 0, 0, 0, 0);

                        PdfCopy c = new PdfCopy(doc, new
FileStream(lWorkFileName, FileMode.Create));

                        doc.Open();

 

                        PdfReader reader = new
PdfReader(lOriginalFileName);

                        for (int i = 1; i <= reader.NumberOfPages; i++)

                        {

                            reader.GetPageN(i).Put(PdfName.PAGE, new
PdfRectangle(A4POINTSWIDTH, A4POINTSHEIGHT));

                            c.AddPage(c.GetImportedPage(reader, i));

                        }

                        doc.Close();

                        c.Close();

 

But the resulting document still has the same problem: looks like an A4
within code, but it's something else, though.

 

May anybody help me please?

 

Thanks.

 

Regards

 

Massimo

 

 

------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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