set the scollbar to a specific position  SOLVED

PDF-XChange Editor SDK for Developers

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

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
AteBe
User
Posts: 63
Joined: Thu Dec 06, 2018 7:02 am

set the scollbar to a specific position

Post by AteBe » Wed Feb 13, 2019 11:46 am

Hallo,
I have a one-page document and try to set the scollbar to a specific position.
In the FullDemo application I found no example.
Is that possible and if so, how?
AteBe

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14037
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: set the scollbar to a specific position

Post by Tracker Supp-Stefan » Mon Feb 18, 2019 12:33 pm

Hello AteBe,

Is it that you want to place the scroll bar on a different location than the default (right of the main rendering area), or is it that you want to have the page scrolled down to a specific place?

Regards,
Stefan

AteBe
User
Posts: 63
Joined: Thu Dec 06, 2018 7:02 am

Re: set the scollbar to a specific position

Post by AteBe » Mon Feb 18, 2019 12:38 pm

Hallo Stefan,
sorry for the unclear question.
I try to scroll the page down to a specific place?
The position of the scrollbar itself is ok.
AteBe

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

Re: set the scollbar to a specific position

Post by Sasha - Tracker Dev Team » Mon Feb 18, 2019 12:39 pm

Hello AteBe,

To do that, use this method:
https://sdkhelp.tracker-software.com/vi ... estination

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

AteBe
User
Posts: 63
Joined: Thu Dec 06, 2018 7:02 am

Re: set the scollbar to a specific position

Post by AteBe » Mon Feb 25, 2019 8:35 am

Hallo Alex,

thanks for the example. However, I have problems translating the code into Java.

In the PDFXChange Viewer the following JavaScript was used for setting the scroll Position:

var a = new Object; a.pageViewLayoutMode=2; a.pageViewZoom=114.58000183105467; a.pageViewZoomType=0; a.pageViewRow=0; a.pageViewBX=0; a.pageViewBY=0; a.pageViewX=53.666155326539695; a.pageViewY=250.6981964111328; a.pageViewPageNum=0; this.viewState = a;

According to the post viewtopic.php?f=62&t=30858 every Javascript that worked in the PDFXChange viewer should also work in the PDFXChange Editor.

Can you tell me why it one does not work anymore in the PDFXChange Editor?

AteBe

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

Re: set the scollbar to a specific position

Post by Sasha - Tracker Dev Team » Mon Feb 25, 2019 8:56 am

Hello AteBe,

Does this work in the End-User Viewer and Editor? Also, why are you using the JS if there is an SDK code that should be used instead (there is a sample in the link I mentioned)?

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

AteBe
User
Posts: 63
Joined: Thu Dec 06, 2018 7:02 am

Re: set the scollbar to a specific position

Post by AteBe » Mon Feb 25, 2019 9:17 am

Hallo Alex,
I replace in our application the PDFXChange Viewer with the PDFXChange Editor. Therefore I try to set the scrollbar in the PDFXChange Editor.
Since our application is developed in Java, I've tried to translate the example you've sent me into Java.
Unfortunately, I did not manage that. So the alternative would be Javascript.
Or do you know what the sample code looks like in Java?
AteBe

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

Re: set the scollbar to a specific position

Post by Sasha - Tracker Dev Team » Mon Feb 25, 2019 9:50 am

Hello AteBe,

I see. Sadly there is no sample in Java. Try using your JS in both End-User Editor and Viewer and see whether it works.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

AteBe
User
Posts: 63
Joined: Thu Dec 06, 2018 7:02 am

Re: set the scollbar to a specific position

Post by AteBe » Mon Feb 25, 2019 9:57 am

Hallo Alex,

I tried that. Unfortunately, the following JavaScript does not work either.

var a = new Object; a.pageViewLayoutMode=2; a.pageViewZoom=114.58000183105467; a.pageViewZoomType=0; a.pageViewRow=0; a.pageViewBX=0; a.pageViewBY=0; a.pageViewX=53.666155326539695; a.pageViewY=250.6981964111328; a.pageViewPageNum=0; this.viewState = a;

Do you have any idea why?

AteBe

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

Re: set the scollbar to a specific position

Post by Sasha - Tracker Dev Team » Mon Feb 25, 2019 12:43 pm

Hello AteBe,

Just tried your script in the End-User Editor - from what I see, it moved the page position along with zoom.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

AteBe
User
Posts: 63
Joined: Thu Dec 06, 2018 7:02 am

Re: set the scollbar to a specific position

Post by AteBe » Wed Feb 27, 2019 12:35 pm

Hallo Alex,
I also tried the script in in the End-User Editor an nothing happend.
Is there a way to get log-informations to find out, what went wrong with my call?
AteBe

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

Re: set the scollbar to a specific position  SOLVED

Post by Sasha - Tracker Dev Team » Mon Mar 04, 2019 9:55 am

Hello AteBe,

I opened a multi-page document, copied your script, opened the JS Console (Ctrl+J) pasted it there and ran it - the left top corner is 53/250 zoom is 6400 and the pages layout is Continuous. Make sure that you have the JS Enabled:
image.png
Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply