tags:

views:

72

answers:

1

I have a PDF document that I just received via file upload (InputFile).

I'd like to use iTextSharp to check it's page size before proceeding. For example, the size of a pdf when you go to file > Properties > Description Tab > Page Size (in acrobat).

Any advice on how I can do that?

THANKS!

+2  A: 

You need to read the pdf from your input stream.

PdfReader reader = new PdfReader(m);
PdfImportedPage page = writer.GetImportedPage(reader, i);
// size information
//page.PageSize.Width
//page.PageSize.Height
Andreas Rehm