I've running into an issue with obtaining property values in code. The property value doesn't seem to return the correct result after a user interaction with the toolbar.
For example, before opening a document I do the following:
SetProperty('PageDisplay.DefaultZoom', 'FitWidth', 0);
The document opens fine to FitWidth. But then I click the "FitPage" button on the toolbar and immediately check the value via code like this:
GetProperty('PageDisplay.DefaultZoom', FDefaultZoom, 0);
However, FDefaultZoom give me the value of 'FitWidth' NOT 'FitPage' which it should since I just clicked the FitPage button on the toolbar.
My application is setup like a viewer where the user clicks from a list of PDF files. If the user changes a settings like DefaultZoom etc, while on one document, I want to make sure that same setting comes through when the user clicks on the next document. I have also set the following values:
SetProperty('Documents.RestoreLastPageDisp', 0, 0);
SetProperty('Documents.RestoreLastView', 0, 0);
Right now, every new document that is opened goes back to the DefaultZoom that I originally set in code and does NOT reflect what as last selected on the Toolbar. The latter is what I want.
Issue Obtaining Property Values in Code After UI interaction
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 923
- Joined: Wed Sep 30, 2009 6:53 pm
-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Issue Obtaining Property Values in Code After UI interaction
Hi, jeffp
So, if you want to obtain the actual zoom-property of the opened document, you should use:
GetDocumentProperty(0, 'Pages.Zoom', FActualZoom, 0);
See more 'ActiveX SDK Help/Reference/Named Items/Objects/Documents/<Item>/Pages'.
Best
Regards.
The property 'PageDisplay.DefaultZoom' is a global option and used by our AX-control during document opening as start zoom-value and it isn't property of the document.For example, before opening a document I do the following:
SetProperty('PageDisplay.DefaultZoom', 'FitWidth', 0);
The document opens fine to FitWidth. But then I click the "FitPage" button on the toolbar and immediately check the value via code like this:
GetProperty('PageDisplay.DefaultZoom', FDefaultZoom, 0);
However, FDefaultZoom give me the value of 'FitWidth' NOT 'FitPage' which it should since I just clicked the FitPage button on the toolbar.
So, if you want to obtain the actual zoom-property of the opened document, you should use:
GetDocumentProperty(0, 'Pages.Zoom', FActualZoom, 0);
See more 'ActiveX SDK Help/Reference/Named Items/Objects/Documents/<Item>/Pages'.
Best
Regards.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.