Get PDF page size with iTextSharp

I have a PDF document that I just got through uploading a file (InputFile).

I want to use iTextSharp to check the page size before continuing. For example, the pdf file size when going to the file> Properties> Description tab> Page size (in acrobat).

Any tips on how I can do this?

THANKS!

+4
c # itextsharp
source share
1 answer

You need to read the pdf file from the input stream.

PdfReader reader = new PdfReader(m); PdfImportedPage page = writer.GetImportedPage(reader, i); // size information //page.PageSize.Width //page.PageSize.Height 
+4
source share

All Articles