web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : KQEXakZcBuJlFINg6ECfap
Power Apps - Building Power Apps
Answered

pdf refresh?

Like (0) ShareShare
ReportReport
Posted on 3 Aug 2017 20:24:38 by

Hi 

 

Is it possible to refresh a pdf viewer in powerapps? Scenario is this, I have a pdf who is a couple of pages long, when a user logs out and someone else logs in, the pdf opens up on the page it was last left by the last user. (I hope that makes sense). Is there a way to refresh the pdf viewer so everytime someone goes to that screen, the page showing is the 1st page>

 

kind regards

 

chrom3d

Categories:
I have the same question (0)
  • v-micsh-msft Profile Picture
    on 04 Aug 2017 at 09:09:03
    Re: pdf refresh?

    Hi @Anonymous,

     

    There is a way to reset the Page property.

    Please take a try to add a context variable PageCount, then put it under PDF Viewer Page proeprty.

    Then under the previous screen Navigate button, change the Navigate formula as below:

    Navigate(PDFscreen, ScreenTransition.None, {PageCount:1})

    Per testing, it does not always work as expected.

    Further, please consider set the showcontrol property to true.

    PDF viewer control in PowerApps

     

    I think it is better to suggest the Product Team to add a reset property of the PDF Viewer control.

    If it is convenient, please consider submit this as an idea under PowerApps idea forum:

    https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

     

    Regards,

    Michael

  • Community Power Platform Member Profile Picture
    on 08 Aug 2017 at 04:21:57
    Re: pdf refresh?

    Hi Michael 

     

    I tried this method but unfortunately it doesn't work for me. As you have suggested I logged this in to the development suggestions and hopefuly there will be a fix for this in the future. It's not a biggie but you know it's just convinient to have the pdf file refreshed to page 1 everytime you go to whatever screen is hosting it rather than stuck on the last page the last person has looked into.

     

    Kind regards

     

    Chrom3d

  • Verified answer
    DA_6654187 Profile Picture
    9 on 10 May 2019 at 20:31:50
    Re: pdf refresh?

    To make this work you need to utilize the OnStateChange Property of the Pdf Viewer

     

    OnStateChange = Set(varPDFPage,PdfViewer1.CurrentPage)

    Page = varPDFPage

     

    Whatever action you are using to call the Pdf (OnStart, OnView or Buttons) add the action  "Set(varPDFPage, 1)" to the command.

  • Community Power Platform Member Profile Picture
    on 04 Nov 2019 at 15:54:10
    Re: pdf refresh?

    I have a similar problem. I have a Gallery of PDF files (from a Document Library, but that doesn't matter). When a user selects a document from the Gallery, I show that PDF in a PDFViewer control (using lookups, but again, that doesn't matter). The PDF then appears and can be browsed. The problem I face without a Reset() function is when the selected gallery document does not have a PDF, the last selected PDF remains displayed.

     

    I want to simply add to the OnSelect of the Gallery Reset(PDFViewer). 

     

    For Brevity, my basic code (psudocode) in the Gallery OnSelect is:

    LookUp(DocumentLibrary, Name = ThisItem.Selected.Title);
    Reset(PDFViewer)

    The basic code (psudocode) of the Gallery Items is:

    SortByColumns(
     Search(
     Filter(DocumentLibrary, DocStatus = "Published"),
     filterTitleInput.Text,
     "DocTitle"
     ),
     "DocTitle",
     Ascending
    )

     For the PDFViewer, I use a helper list where documents are uploaded. Authorized users may upload or delete files to/from the helper list through a form. When files are added to the list, a back-end Flow copies the file to the Document Library and marks it as Published. When a file is deleted from the list, the Flow simply marks the file as Obsolete. The basic code for the PDFViewer Document is:

    First(
     Filter(
     LookUp(
     HelperList,
     Department = Gallery.Selected.DocDepartment &&
     DocumentType = Gallery.Selected.DocTypeB &&
     DocumentNumber = Gallery.Selected.DocSeries &&
     DocumentRevision = Gallery.Selected.DocRevision
     ).'{Attachments}',
     Gallery.Selected.Name
     in DisplayName
     )
    ).Value

     

    So, while the Gallery is showing documents from the Document Library, the PDFViewer is returning the origin document from the sharepoint list. (Not that it matters, but the Launch() for PDFViewer opens the file from the Document Library, not the HelperList).

     

    The need of a Reset() in this process is due to a de-sync which occurs during testing and not during normal process. In addition to a Reset(), the ability to open a File from a Document Library in the PDFViewer would be awesome!

     

  • zelgia Profile Picture
    8 on 03 Jun 2020 at 11:50:37
    Re: pdf refresh?

    I found a work around for the problem that the PDF view remains on the last page visited

  • JLincoln Profile Picture
    69 on 22 Apr 2021 at 14:31:20
    Re: pdf refresh?

    What's the workaround?

  • Community Power Platform Member Profile Picture
    on 06 Oct 2021 at 18:24:50
    Re: pdf refresh?

    I would also like to know what your work around was so that the pdf viewer is starting at the 1st page.

  • Community Power Platform Member Profile Picture
    on 06 Oct 2021 at 18:28:22
    Re: pdf refresh?

    I want to make sure people start at page one and are not able to mark complete until on the last page. I have found that the CurrentPage value is defaulting to 0, it will update if I page through a multi-page document but does not change to 1 with single page documents.

  • JLincoln Profile Picture
    69 on 06 Oct 2021 at 19:19:02
    Re: pdf refresh?

    @Anonymous ,|

    Could you try this sequence of events and see if it works?

    Add a button named btnPdfReset in with the following OnSelect:

    UpdateContext({varPdfPage: Blank()});
    UpdateContext({varPdfPage: 1});
    Reset(PdfControl);

    And then on the OnVisible property of that page
    Select(btnPdfReset);

    And on the PdfControl, set Page = varPdfPage

    See if that works, resetting the PDF control after setting the page in the variable MIGHT solve the issues that @v-micsh-msft was experiencing.

  • Community Power Platform Member Profile Picture
    on 06 Oct 2021 at 19:46:39
    Re: pdf refresh?

    when I add Reset(myPDFviewerControl) I get the error "the function expects a resetable control as input"

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 752 Most Valuable Professional

#2
developerAJ Profile Picture

developerAJ 472

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 358 Super User 2025 Season 2

Last 30 days Overall leaderboard
Loading complete