We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

DPI of loaded document

How can I query the DPI of an existing PDF document?

1 Reply

SS Sathish Sivakumar Syncfusion Team May 18, 2016 11:23 AM UTC

Hi Bob, 
Thank you for using Syncfusion Products. 
PDF document does not have DPI, since it is a vector format. 
However, we can get the height and width of the PDF document by using the PageSettings of PdfDocument. Please find the below code snippet to get the height and the width of the PDF document using the PageSettings of PdfDocument. 
Code Snippet: 
PdfLoadedDocument ldoc = new PdfLoadedDocument("../../Data/Barcode.pdf"); 
PdfDocument document = new PdfDocument(); 
PdfPageBase page = document.ImportPageRange(ldoc, 0, ldoc.Pages.Count - 1); 
SizeF pageSize=document.PageSettings.Size; 
float height = pageSize.Height; 
float width = pageSize.Width; 
We have also created the simple sample which illustrates the same. Kindly check out the sample from the below link: 

Live Chat Icon For mobile
Up arrow icon