set the scollbar to a specific position  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, 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
AteBe
User
Posts: 63
Joined: Thu Dec 06, 2018 7:02 am

set the scollbar to a specific position

Post by AteBe »

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

Re: set the scollbar to a specific position

Post by Tracker Supp-Stefan »

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 »

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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: set the scollbar to a specific position

Post by Sasha - Tracker Dev Team »

Hello AteBe,

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

Cheers,
Alex
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 »

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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: set the scollbar to a specific position

Post by Sasha - Tracker Dev Team »

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
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 »

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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: set the scollbar to a specific position

Post by Sasha - Tracker Dev Team »

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
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 »

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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: set the scollbar to a specific position

Post by Sasha - Tracker Dev Team »

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
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 »

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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: set the scollbar to a specific position  SOLVED

Post by Sasha - Tracker Dev Team »

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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply