How can I open a document centered?

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

relapse
User
Posts: 167
Joined: Wed Jan 18, 2012 11:10 am

How can I open a document centered?

Post by relapse »

Hi, I'd like to force a document opened with a command OpenDocument to be shown centered in the viewer.


I suppose it could be achieved with a command like:

pdfViewer.SetProperty("Documents[0].xy", "xyz");


But I can't find the correct property. :cry:


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

Re: How can I open a document centered?

Post by Stefan - PDF-XChange »

Hi Relapse,

I believe yon need the MovePointToScreenPoint method - and you can then move the center of the document to the center of the Viewer AX rendering area to get your page centered in the view.

Please also check this topic where Vasyl has provided some samples:
https://forum.pdf-xchange.com/ ... 938#p42938

Best,
Stefan