Width of loadedDocument

Hi, 

I wanted to get programmatically the width of a loaded document in the PdfViewControl (or PdfDocumentView) 

I use this property "MyViewer.LoadedDocument.Pages[0].Graphics.Size.Width" but I also tried with "MyViewer.LoadedDocument.Pages[0].Size.Width".

With a classic A4 72 dpi document (portrait mode) with Zoom 100%, I am supposed to obtain around 790 pixels. But with the Syncfusion control, I get 595 pixels.

That corresponds to the width with Zoom 75% 

Did I use a wrong property? Is there a bug?

Thanks for advance

Regards,

Marvin

2 Replies

SP Sathya Ponnusamy Syncfusion Team January 15, 2018 01:00 PM UTC

Hi Atlante, 

Thank you for contacting Syncfusion support. 

We are using point as a measuring unit. We can achieve your requirement by convert the point to pixel. please refer the below code to convert same.  

PdfUnitConvertor converter = new PdfUnitConvertor(); 
float width = converter.ConvertUnits(ldoc.Pages[0].Graphics.ClientSize.Width, PdfGraphicsUnit.Point, PdfGraphicsUnit.Pixel); 
  
Please let us know if you need further assistance on this. 

Regards, 
Sathya 




AD Atlante Dev Team January 15, 2018 01:19 PM UTC

Hi, 

Thanks for the answer! 

Regards, 
Marvin

Loader.
Up arrow icon