Scrolling uisng arrow keys

11 posts, 1 answers
  1. Ritwick
    Ritwick avatar
    11 posts
    Member since:
    Sep 2012

    Posted 06 Jun 2013 Link to this post

    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
  2. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 07 Jun 2013 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Ritwick
    Ritwick avatar
    11 posts
    Member since:
    Sep 2012

    Posted 11 Jun 2013 Link to this post

    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
  5. Wenjie
    Wenjie avatar
    35 posts
    Member since:
    Mar 2013

    Posted 11 Jun 2013 Link to this post

    myPdfViewer.VerticalScrollBar.Value

  6. Ritwick
    Ritwick avatar
    11 posts
    Member since:
    Sep 2012

    Posted 12 Jun 2013 Link to this post

    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
  7. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 12 Jun 2013 Link to this post

    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.

  8. Ritwick
    Ritwick avatar
    11 posts
    Member since:
    Sep 2012

    Posted 18 Jul 2013 Link to this post

    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
  9. Ritwick
    Ritwick avatar
    11 posts
    Member since:
    Sep 2012

    Posted 19 Jul 2013 Link to this post

    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
  10. Answer
    Anna
    Admin
    Anna avatar
    99 posts

    Posted 22 Jul 2013 Link to this post

    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 >>
  11. Ritwick
    Ritwick avatar
    11 posts
    Member since:
    Sep 2012

    Posted 01 Aug 2013 Link to this post

    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.
  12. Ritwick
    Ritwick avatar
    11 posts
    Member since:
    Sep 2012

    Posted 18 Oct 2013 Link to this post

    Checked against the Q3 2013 release, the scrolling with arrow keys is working fine.

    Thanks
    Ritwick
Back to Top
UI for WPF is Visual Studio 2017 Ready