viewState needed  SOLVED

A forum for questions or concerns related to the PDF-XChange Core API SDK

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
AnKeilha
User
Posts: 63
Joined: Fri Apr 27, 2018 11:17 am

viewState needed

Post by AnKeilha »

Hello again,
we are using the (old/discontinued) PDFXChange viewer in our system and are currently in the process of migrating to the new PDF-XChange Editor. Using the old API, we could execute the following JavaScript to find out information on document position, including pageViewZoom, pageViewX/Y, pageViewBX/Y, pageViewRow and pageViewPageNum:

var result = " ";for (var key in this.viewState) {result = result + key + "=" + this.viewState[key]+ " "; };result;

Is this still possible with the new API?

Thank you very much in advance.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17820
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: viewState needed

Post by Tracker Supp-Stefan »

Hello AnKeilha,

I believe all you need is in the PagesLayoutManager interface:
https://sdkhelp.pdf-xchange.com/vi ... outManager

Regards,
Stefan
AnKeilha
User
Posts: 63
Joined: Fri Apr 27, 2018 11:17 am

Re: viewState needed

Post by AnKeilha »

Thank you for your response. We are using the information from viewState to do the following: Given the position of a mouse click, find the exact PDF coordinates the user clicked on (e.g.: (842.0, 595.0) for the very top right corner of a DIN A4 page). Calculating this using the viewState worked pretty well for us in the past, but I am wondering whether there is an easier way to do this.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: viewState needed  SOLVED

Post by Sasha - Tracker Dev Team »

Hello AnKeilha,

Well this is not a Core API topic - please post in the Editor SDK thread in the future.
As for the topic itself - the IPXV_Control has some of the methods/properties that you can use to extract data that you need:
https://sdkhelp.pdf-xchange.com/vi ... XV_Control
Also, you can use the LayoutManager that Stefan mentioned to get more detailed data. Here's a code snippet on how to get to it:

Code: Select all

pdfCtl.Doc.ActiveView.PagesView.Layout
Also, check the FullDemo application that comes with the SDK - it has the code snippet that you need in the Document Tab:
https://github.com/tracker-software/PDF ... p/FullDemo

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply