Jump to a page

3 posts, 1 answers
  1. Sehe
    Sehe avatar
    14 posts
    Member since:
    Jun 2011

    Posted 26 Sep 2012 Link to this post

    Hello,

    I'm trying to use the PDF viewer to look at a specific page number in a pdf document. I try to set the document source, and then set the CurrentPageNumber property. The viewer will still only load the pdf on the first page. Is there a different way to jump to a specific page in the document?

    I used the following:
    PdfDocumentSource newDoc = new PdfDocumentSource(new Uri(@"C:\12345.pdf"));
    pdfViewer.DocumentSource = newDoc;
    pdfViewer.CurrentPageNumber = 5;

  2. Answer
    Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 27 Sep 2012 Link to this post

    Hi Scott,

    The problem is that when you set the CurrentPageNumber, the document has not been loaded yet as the document is loaded asynchronously. Therefore, this code is ignored.

    I can suggest you set this property on DocumentChanged event of the RadPdfViewer or the Loaded event of the PdfDocumentSource. Then this code should work as expected.

    Greetings,
    Kammen
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Sehe
    Sehe avatar
    14 posts
    Member since:
    Jun 2011

    Posted 27 Sep 2012 Link to this post

    Hi Kammen,

    That worked great. Thank you for the quick response.
Back to Top