I am using PdfSharp to read / write pdf in our application. I am trying to get the paper size of the page to show in metadata window. I am using following code to do the same:
Code:
// read PDF document into memory
var pdfDocument = PdfReader.Open(pdfPath);
// if PDF document have more than one page, then try to get the page size from first page
if (pdfDocument.Pages.Count > 0)
{
var pageSize = pdfDocument.Pages[0].Size.ToString();
} // if
But every time it returns 'Undefined', I even tried to create A4 page document for MS Word. But still, it returns 'Undefined'.