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
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!
@TMAC27 ,
Yes it could be a bug and I have found issues with the proper display of images as well.
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
Searching for the solution for same issue.
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.
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
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.
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
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473