Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Experimental Features
Unanswered

PDF Function Huge Slowdown

(1) ShareShare
ReportReport
Posted on by 68

Creating PDFs is notoriously difficult in Power Apps unless you are okay with a simple Word template. We started to use this function together with Power Automate to generate PDFs when the business logic of PDF content increased as well as requirement for quick PDF creation. It's been a few months now that PDF function worked like a charm for us.

We have a rather non-trivial A3 custom page which displays few pictures from SharePoint depending on the currently opened record in model-driven app which upon clicking a button triggers a PDF function and the result of the PDF function is sent to Power Automate to create a file on SharePoint as per MS official docs for working with PDF function.

However, in the last week or so, the previously amazing time of about 10s became 2+ minutes! I could not quite believe this at first when it was reported and went on to check network and computer of the user, but to my surprise the result is same for everyone.

The problem:

Simply put - Pictures.

Specifically the ones from SharePoint. We already overcame the issue that URL are not sufficient for PDF function, so we were using Power Automate to get the file contents. This was the first thing that we changed to use only thumbnails instead of base64 of the entire picture (thought that could have been unnecessary to transfer that much data). Did not help tho.

Weird behavior difference between Power Apps Studio and MD App:

In Power Apps Studio the PDF function takes a bit longer than before (about 15s) but that would be completely fine. When using MD App in play mode however, the time to complete PDF function skyrockets. Upon investigating the network traffic that happens when the PDF function runs, we have found Synchronous XHR warnings in console (since the PDF function worked on our first try I cannot tell is those warnings are new or not). Another interesting finding is that sometimes there can be some Fluid Relay requests when creating the PDF which I had no luck trying to find out what they might be, the URL of those is always something similar to this wss://alfred.northeurope-6.fluidrelay.azure.com/socket.io/?documentId=e138e7ac-4c55-473c-89a3-43435f4d4d5c&tenantId=a58db88d-76b2-4983-8a4c-fe50824556d4&EIO=4&transport=websocket.

What we've tried:

  • Image component with base64 string of image
  • HTML text component with img tag with src set to base64 of image

What we're going to try:

There is one more option left which we did not try, and that is to convert the custom page into standalone canvas app to be able to monitor the app and see if the behavior is the same (monitor for MD apps currently does not work). But before we spend another hours trying to get the experimental PDF function to work, I thought why not ask, maybe someone is facing the same issue or some insider is going to answer.

 

So please, can someone from the PDF function team explain what is happening here and how are we supposed to work with pictures?

Categories:
  • Viliam Juricek Profile Picture
    68 on at
    Re: PDF Function Huge Slowdown

    So I have tried the standalone Canvas App to do the exactly same as in the custom page and standalone canvas app seems to work as the custom page did before -> PDF function generated pdf with images in under 5 seconds.

    So our problem would be solved now to make canvas apps from the custom pages, but it really seems strange that this happens. Isn't there by any chance some setting I have missed for Model-driven apps or Custom Pages anyone knows about which can be causing this?

    Any reply would be equivalent to gold now:D

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics