Skip to main content
Community site session details

Community site session details

Session Id : ++BodxLE73Ot9pTkBZvvMg
Power Apps - Building Power Apps
Answered

PDF not load photo

Like (0) ShareShare
ReportReport
Posted on 16 Jan 2023 15:21:13 by 25

Hello,
Uploads pictures to the sharepoint list as attachments. Everything saves correctly. Then I display all items from sharepoint list and all photos from attachments (as Gallery). Everything works on the screen. Then I create a PDF (using the PDF() function), and immediately upload it as an email attachment. My problem is that if I have pictures up to about 0.5MB they load correctly into PDF, if I have pictures bigger they don't load into PDF and PDF have errors. PDF file has 2 pages of content and then 100 empty. It should only have 2 pages.

Images are uploaded using a form (UploadedImage, AddMediaWithImage, attachCtrl)

 

Sharepoint list attachment collection code:

Collect(colAttachments;{DisplayName:"("&zm_ostatni_audyt&")"&GUID()&".jpg"; ID:"("&zm_ostatni_audyt&")"&GUID()&".jpg"; Id:"("&zm_ostatni_audyt&")"&GUID()&".jpg"; Value:UploadedImage3_1.Image});;
Reset(attachCtrl1_1)

 

Code to generate PDF and send email:

Office365Outlook.SendEmailV2(User().Email;"PDF"; "Body email";{Attachments:Table({Name:var_tmp &"_nr_"&number&".pdf";ContentBytes:PDF(Gallery4_1;{Size:A4;ExpandContainers:true})});

 

How to generate a PDF so that large photos load properly Or how to reduce the size of the photo before uploading to shapepoint list

 

 

Categories:
  • aseel Profile Picture
    4 on 20 Jun 2025 at 10:06:49
    PDF not load photo

    Still struggling with the PDF Viewer and image attachments:
    I upload pictures to a SharePoint list as attachments.

    ✅ I’ve verified that everything is saved correctly.

    ✅ I also load the attachments into a collection to ensure there’s no issue with the image data.

    âś… The images are displayed in a Gallery without any problem.

    âś… Then I generate a PDF using the PDF() function and immediately send it as an email attachment.

     

     The issue:

    Some images randomly don’t appear in the generated PDF.

    It’s inconsistent — the same image might appear in one PDF but be missing in another.

    It doesn’t seem related to image size either — even larger images load fine.

     

    Has anyone encountered this issue or found a workaround to ensure all images consistently render in the PDF?

     

    Thanks in advance!

  • WarrenBelz Profile Picture
    149,102 Most Valuable Professional on 12 Aug 2023 at 03:23:22
    Re: PDF not load photo

    @TMAC27 ,

    Yes it could be a bug and I have found issues with the proper display of images as well.

  • TMAC27 Profile Picture
    8 on 11 Aug 2023 at 17:46:24
    Re: PDF not load photo

    It's been awhile but I tried your solution. (No Flow). If I have the company logo a 25KB PNG on the screen of my Canvas App it does not show in the pdf and I get an error: Insufficient data for an image. I remove the logo from it and the PDF is generated as expected. I am beginning to think that there is a bug in the experimental add-on. Unless you can suggest something else. If you want, I can post it as an original question. Thanks

  • Community Power Platform Member Profile Picture
    on 15 Feb 2023 at 08:56:10
    Re: PDF not load photo

    Searching for the solution for same issue.

  • WarrenBelz Profile Picture
    149,102 Most Valuable Professional on 17 Jan 2023 at 21:20:08
    Re: PDF not load photo

    Hi @blazejgorecki ,

    Yes, it is a new function, so that may be the case

  • blazejgorecki Profile Picture
    25 on 17 Jan 2023 at 15:46:40
    Re: PDF not load photo

    Nice tutorial. However, in my case it doesn't solve the problem. This is definitely a problem with the generation of the PDF file by the PDF() function. By pdfviewer control I display generated variable with pdf file. Still my photos are not loading properly.

  • Verified answer
    WarrenBelz Profile Picture
    149,102 Most Valuable Professional on 17 Jan 2023 at 10:34:50
    Re: PDF not load photo

    @blazejgorecki ,

    This blog of mine may be useful to you.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • blazejgorecki Profile Picture
    25 on 17 Jan 2023 at 10:05:45
    Re: PDF not load photo

    I am not using Power Automate to generate the PDF. I am using functions from PowerApps. Shouldn't the PDF generation be finished before the email send function is called. But I don't know how to make the variable containing the PDF an attachment to Emial.

  • WarrenBelz Profile Picture
    149,102 Most Valuable Professional on 16 Jan 2023 at 20:38:31
    Re: PDF not load photo

    Hi @blazejgorecki ,

    I assume you are using HTML to create the PDF in Power Automate ? There is a "hard limit" of 2mb total size for any images here - no workaround as far as I know.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete