This is a migrated thread and some comments may be shown as answers.

Scrolling uisng arrow keys

10 Answers 296 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Ritwick
Top achievements
Rank 1
Ritwick asked on 06 Jun 2013, 11:00 AM
Hi,

The PDFViewer does not scroll correctly using up/down arrow keys, sometimes it does nothing and sometimes it jumps. Is scrolling supported uisng arrow keys? Is there any API available to scroll line by line like jumping to specific page or page up/down?

Thanks
Ritwick

10 Answers, 1 is accepted

Sort by
0
Kammen
Telerik team
answered on 07 Jun 2013, 08:44 AM
Hi Ritwick,

Currently, arrows are used to change the caret position. Obviously, this is not very convenient when RadPdfViewer is not in TextSelection mode. We will consider implementing scrolling with the arrow keys when the document is not in TextSelection mode.

For now there is API that can work around this - the GoToDestination method where you can specify the page and offset for the destination.

Regards,
Kammen
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Ritwick
Top achievements
Rank 1
answered on 11 Jun 2013, 11:13 AM
Hi,

I could use GoToDestination with success. But suppose user has scrolled using the scrollbar and then tries to scroll using arrow keys, I need to get the current page no as well as offset for the starting point for GoToDestination method. But after looking at the API, I couldn't find any api to get the offset (y direction). Is there any api to know the vertical offset within the current page?

Thanks
Ritwick
0
Wenjie
Top achievements
Rank 1
answered on 11 Jun 2013, 03:17 PM

myPdfViewer.VerticalScrollBar.Value

0
Ritwick
Top achievements
Rank 1
answered on 12 Jun 2013, 07:41 AM
No, the offset value that is provided to GoToDestination do not match with the value that I get from VerticalScrollBar.Value.

To make it clear,

Suppose I want to scroll down using arrow key.

1. Scenario, I am currently at the top of the first page,
I need to do this when arrow key down is pressed -
Telerik.Windows.Documents.Fixed.Model.Navigation.Destination d =
                    new Telerik.Windows.Documents.Fixed.Model.Navigation.Destination(this.RadPdfViewer.Document.Pages[0], 0, 15);
this.RadPdfViewer.GoToDestination(d);
where 15 is random value that gives the amount I would like to scroll.
2. Scenario, I am currently at the middle of the 1st page. Now the arrow key down is pressed, so I need to scroll +15 to the current offset position. But I do not know the current offset. If I use VerticalScrollbar.Value, the behavior is not what expected.
Telerik.Windows.Documents.Fixed.Model.Navigation.Destination d =
                    new Telerik.Windows.Documents.Fixed.Model.Navigation.Destination(this.RadPdfViewer.Document.Pages[0], 0, x + 15);
this.RadPdfViewer.GoToDestination(d);
In the above code, how to know the correct x value?

Thanks
Ritwick
0
Kammen
Telerik team
answered on 12 Jun 2013, 11:46 AM
Hello Ritwick,

There is no appropriate API that will give you current offset, so the GoToDestination method will not help you work around this.

We have scheduled the issue with high priority for the Q2 SP1 2013 release. We are sorry for the inconvenience.

Regards,
Kammen
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Ritwick
Top achievements
Rank 1
answered on 18 Jul 2013, 10:01 AM
Hi,

Do we have the API support to determine the current offset in 2013.2.0611 release? I didn't find anything specific to this in the release notes.

Thanks
Ritwick
0
Ritwick
Top achievements
Rank 1
answered on 19 Jul 2013, 07:36 AM
Did not see any response to my last post so posting again.

Is any API available to determine the current offset in the latest Q2 release?

Thanks
Ritwick
0
Accepted
Anna
Telerik team
answered on 22 Jul 2013, 02:52 PM
Hello Ritwick,

As promised, we've fixed the scrolling with arrows for the Service pack. The Service pack is expected to be released some time this week. I hope that given this, you won't need a way to determine the current offset, as your initial concern will be taken care of.

Please, let us know if you have any further questions.

Regards,
Anna
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Ritwick
Top achievements
Rank 1
answered on 01 Aug 2013, 12:59 PM
Hi,

The arrow keys work but the service pack is buggy. There is null reference exception when I am changing from one document to another. I have raised a ticket  722160 on this.

Thanks
Ritwick

Update: Ignore this post as the null reference source was from my code. The released service pack is fine. Apology for any inconvenience.
0
Ritwick
Top achievements
Rank 1
answered on 18 Oct 2013, 09:51 AM
Checked against the Q3 2013 release, the scrolling with arrow keys is working fine.

Thanks
Ritwick
Tags
PDFViewer
Asked by
Ritwick
Top achievements
Rank 1
Answers by
Kammen
Telerik team
Ritwick
Top achievements
Rank 1
Wenjie
Top achievements
Rank 1
Anna
Telerik team
Share this question
or