[javascript FR] doc.viewState when view is in split view

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: Daniel - PDF-XChange, PDF-XChange Support, Paul - PDF-XChange, Vasyl - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

User avatar
Mathew
User
Posts: 960
Joined: Thu Jun 19, 2014 7:30 pm

[javascript FR] doc.viewState when view is in split view

Post by Mathew »

When a document is in split view (horizontal, vertical or spreadsheet) is there any way that javascript can know this? And can javascript get/set what zoom/position/page/etc that each of the views are and which of the views is active? If not, is this something that could be implemented?

tl;dr
I assume that because each split view can have different settings for many of the parameters of doc.viewState, that either there would need to be another property (ie doc.viewStates) that is an array of each viewState; or the relevant parameters would need to revert to arrays. IMO the first option would be the better one (easy to check if it's supported ie doc.viewStates !== undefined). I have a tool that I use to save views when I'm working on shop drawings, because one needs to be able to quickly jump back and forth between arbitrary locations in the pages viewtopic.php?t=48179 but it doesn't work properly in split views. I'd need something like this to make it work better.
User avatar
Sean - PDF-XChange
Site Admin
Posts: 1517
Joined: Wed Sep 14, 2016 5:42 pm

Re: [javascript FR] doc.viewState when view is in split view

Post by Sean - PDF-XChange »

Hi Mathew,

I'm not aware of any existing JavaScript functionality that enables the detection of split-view mode or the independent manipulation of the view state of each pane. Your suggestion of introducing a doc.viewStates property seems like a sensible approach, particularly in terms of maintaining backward compatibility with existing scripts. I'll pass this on to the development team for consideration and see what they think about the feasibility of implementing this functionality.

Kind regards,
Sean Godley
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623