Setting PageDisplay.DefaultZoom not working?

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

JGForwick
User
Posts: 16
Joined: Fri Jan 21, 2011 7:17 pm

Setting PageDisplay.DefaultZoom not working?

Post by JGForwick »

Hi there,

I am experiencing issues trying to set the default zoom mode of the viewer to 'FitWidth'.

I'm setting the property via...

Code: Select all

// this line should be setting the default property
pdfXChangeViewer.SetProperty("PageDisplay.DefaultZoom", "FitWidth", 0);
However when a file is then loaded it is coming up being displayed as fit all. What is strange is that if check the defaultzoom immediately after loading the property...

Code: Select all

pdfXChangeViewer.GetProperty("PageDisplay.DefaultZoom", out dataOut, 0);
it is still showing -2.0 aka 'FitWidth'. However if i check the ZoomMode of the pages...

Code: Select all

pdfXChangeViewer.GetProperty("Documents[activeDocument].Pages.ZoomMode", out dataOut, 0);
it is returning a 3 which is 'FitPage'.

Any idea why there would be discrepancy between what the defaultzoom is set at and what the zoom of the file is after it is loaded?

Thanks in advance
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Setting PageDisplay.DefaultZoom not working?

Post by Stefan - PDF-XChange »

Hello JGForwick,

In your tests are you trying with the same file?
Is it possible that the "Restore Last used Layout and Zoom settings for pages from the Recent List when opening" be affecting the behaviour you expect? The command name for the SDK is "RestoreLastPageDisp" and the default value is 1 (true).

Best,
Stefan