PDF Function in Power Apps | Create PDF Documents from Screens, Galleries & Containers

Поділитися
Вставка
  • Опубліковано 19 лип 2024
  • Power Fx PDF function allows us to create PDF documents directly from PowerApps screens, galleries and containers. The generated PDF Blob can be used to showcase the PDF in a PDF Viewer control in Power Apps, or send an email with PDF File as attachment or save the generated PDF File in a SharePoint Document Library with the help of Power Automate flow.
    PDF function in Power Apps -
    learn.microsoft.com/en-us/pow...
    🚩 Connect with me on social:
    - LinkedIn: / vipul0309
    - Twitter: / jainvipulcs
    - Facebook: / vipuljain0309
    🔔 Subscribe to my UA-cam channel
    / vipuljaineducation
    #powerapps #sharepoint #powerplatform #powerautomate #powerfx #sharepointonline

КОМЕНТАРІ • 23

  • @salaroenterprises
    @salaroenterprises Місяць тому

    Very nice job.Really understood from Kenya.

  • @jray1429
    @jray1429 4 місяці тому

    Great job! Thank you. Do you happen to have a video on how to link to that file to download without going to the sharepoint site?
    Thanks again for your work!

    • @VipulJainEducation
      @VipulJainEducation  4 місяці тому

      I don't have a video on this, thanks for this idea - I will create one and share the link. However for now let's assume the PDF file is in SharePoint Library and you want to get it downloaded in Power Apps screen. Then you can use this special URL to bypass the SharePoint document viewer and download the file.
      .sharepoint.com/sites//_layouts/15/download.aspx?SourceUrl=/sites//

  • @user-wc4pm9zc4j
    @user-wc4pm9zc4j Рік тому +1

    I am working on Power Apps, and I have created multiple screens from a PDF without using any data source. Now, I want to add a search functionality to my first (main) page, where we can search the content or title directly. Can you help me understand how to use the search function in this case?

    • @VipulJainEducation
      @VipulJainEducation  Рік тому

      It seems to be a static app. When you say no data source is used, then everything is getting stored in Power Apps memory, which is not an ideal solution to implement.
      In this case, what you can do is Extract text from PDF and store in a variable or collection to implement the Search functionality. You can add a PDFViewer control to your app's screen(s) where the PDF content is displayed. Set the PDF property of the PDFViewer control to the source PDF document. Use the PDFViewer1.Text property to extract the text content from the PDF and store it in a variable or collection. For example: ClearCollect(PDFText, { Text: PDFViewer1.Text }).
      Once the text is extracted and stored, you can proceed with implementing the search functionality.

  • @ericbeaudin3741
    @ericbeaudin3741 9 місяців тому

    Hello Sir, thank you for those video ..very instructive :) ..At 22:17 , instead of name "test.pdf" , I want to save it as item title , who do we do it ?

    • @VipulJainEducation
      @VipulJainEducation  9 місяців тому +1

      You can save it in a textbox and take the value from it.

  • @pradeepjamkhandi143
    @pradeepjamkhandi143 3 місяці тому

    Hi Vipul,
    is it possible to create a header and footer for the pdf's which are running more than one pages?

    • @VipulJainEducation
      @VipulJainEducation  2 місяці тому

      With default PDF function, its not possible. If header & footer is required, then you need to create/generate PDF in a dynamic way using custom code and by using some third part libraries (like Muhimbi or iText7). You can also use some premium connectors in Power Automate for the same.

  • @nicolaslimadezen6716
    @nicolaslimadezen6716 11 місяців тому

    Good evening, man I want to click on the button and create a pdf of several screens, is it possible? It is like?

  • @renukasiddaiah4702
    @renukasiddaiah4702 3 місяці тому

    Thanks , i want to create pdf for two screens can you pls wxolain me how to do for two screens

    • @VipulJainEducation
      @VipulJainEducation  3 місяці тому

      If I understand it correctly, you want to create one PDF from the data which is residing in two different screens in the Power Apps - this is not possible. Currently PDF function supports creating the PDF for a screen, container or gallery. Please check official documentation for details and limitations - learn.microsoft.com/en-us/power-platform/power-fx/reference/function-pdf
      Now the possible alternatives -
      1. Check if you can get the data in Power BI and then generate PDF via Power BI.
      2. Call a custom .NET Core based API via Custom Connector. This API wrapper will take the input (e.g. - byte array) from Power Apps and will convert into PDF. For this you might need to use some libraries in .NET (like DynaPDF, PDFClown, iText7, Muhimbi etc.) to convert / generate the PDF.

  • @albertisac3846
    @albertisac3846 Рік тому

    Is it possible to take pdf from SharePoint attachments in power apps

    • @VipulJainEducation
      @VipulJainEducation  Рік тому +1

      Hi Albert. The PDF function takes the snapshot of whatever is available on a screen, container or a gallery (Export contents from the current screen to an object). E.g. - If you have an image on the screen, that would be captured in the PDF. Similarly, if you have an attachment control on the screen showing list of attachments, then those will be printed as-is in the PDF.
      Hope this helps!

    • @trustnonor5139
      @trustnonor5139 Рік тому

      Can we the dynamic file name in the SharePoint folder 📂? ❤

  • @user-yx3ld3nx5e
    @user-yx3ld3nx5e 6 місяців тому

    Hi, i tried this function with vertical gallery and container all these are working fing with expand containers but if i tried a horizontal gallery the expand containers are not working and it is not scrollable horizontable. Is that a bug or we have any other ways?

    • @VipulJainEducation
      @VipulJainEducation  6 місяців тому

      It could be a known limitation as horizontal gallery can be treated as nested gallery and these are not supported. You can proceed with vertical gallery.
      FYI - The ExpandContainers statement is only for expanding a container or gallery, not text or other controls.

  • @mardithpascua8112
    @mardithpascua8112 Рік тому

    did you encounter that some text that should appear in the next page of the PDf is being cut-off incorrectly?

    • @VipulJainEducation
      @VipulJainEducation  Рік тому

      This only happens when you don't use "ExpandContainers" optional parameter with PDF function. The default value of this parameter is false. So you should use it with PDF function and set value as True.
      E.g. - PDF(Screen1, {ExpandContainers: true})

    • @mardithpascua8112
      @mardithpascua8112 Рік тому

      @@VipulJainEducation yeah. I am using it, still having issues with cut off text or graphics between pages

    • @fosbury1341
      @fosbury1341 Рік тому

      @@mardithpascua8112 Did you find a solution? I have the same problems

    • @VipulJainEducation
      @VipulJainEducation  Рік тому

      @@mardithpascua8112 I would suggest making every control in the gallery's y coordinate based on the previous control above it's y coordinate plus it's height. then add an if statement something like below -
      If(PrevControlY+PrevControlHeight+Self.Height>HeightSetForGallery-Someroomformargins, 0, PrevControlY+PrevControlHeight)