how to set Height of the page

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

TatianaS
User
Posts: 103
Joined: Mon Mar 18, 2013 4:26 pm

how to set Height of the page

Post by TatianaS »

Hello, is there a way to set different Height of the page. I have a feature called "Fit to Height"
so I was trying to do this:
//get Width
fPDFViewer.GetProperty('Documents[#29434].Pages.Width', vDataOut, 0);

//set fit to page
fPDFViewer.SetProperty('Documents[#29434].Pages.Zoom', '-1', 0);

//set Width as it originally was
fPDFViewer.SetProperty('Documents[#29434].Pages.Width', vDataOut, 0);

but it fails saying "The property is read only"
Walter-Tracker Supp
User
Posts: 381
Joined: Mon Jun 13, 2011 5:10 pm

Re: how to set Height of the page

Post by Walter-Tracker Supp »

Page width and height are read-only. You need to get and set the zoom level instead.

Code: Select all

// get original zoom
fPDFViewer.GetProperty('Documents[#29434].Pages.Zoom', vDataOut, 0);

//set fit to page
fPDFViewer.SetProperty('Documents[#29434].Pages.Zoom', '-1', 0);

//set zoom as it originally was
fPDFViewer.SetProperty('Documents[#29434].Pages.Zoom', vDataOut, 0);