viewState needed  SOLVED

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

Moderators: Tracker Support, TrackerSupp-Daniel, Chris - Tracker Supp, Vasyl-Tracker Dev Team, 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: 26
Joined: Fri Apr 27, 2018 11:17 am

viewState needed

Post by AnKeilha » Fri Apr 27, 2018 11:51 am

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: 13312
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: viewState needed

Post by Tracker Supp-Stefan » Fri Apr 27, 2018 12:47 pm

Hello AnKeilha,

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

Regards,
Stefan

AnKeilha
User
Posts: 26
Joined: Fri Apr 27, 2018 11:17 am

Re: viewState needed

Post by AnKeilha » Thu May 24, 2018 8:28 am

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.

User avatar
Sasha - Tracker Dev Team
User
Posts: 4075
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: viewState needed  SOLVED

Post by Sasha - Tracker Dev Team » Fri May 25, 2018 6:42 am

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.tracker-software.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
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply