cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
bigal2019
Level: Powered On

Convert Form with Image Gallery to PDF Possibly with Flow

Hi,

I have a PowerApp that connects to a SharePoint list.  There is an Attachment Control that allows users to add up to 10 attachments.  These attachments are expected to be images.  On my display screen, I show the list item details plus an Image Gallery with all of the images.  My users need to be able to print the form data plus all images.  

 

Initially, I created a button which sends an HTML email that adds the images as attachments.  However, my users need to have everything together to be able to print as one document....so the email with attachments method will not suffice.  Ideally, I would like to be able to generate a PDF.  I've seen videos on how to create a PDF using FLOW. These only seem to take the HTML and possibly include one static image saved somewhere.  I need to be able to loop through and add ALL of the image attachments associated with a particular list item.  In PowerApps, I don't see that there is a way to dynamically build the HTML based on on all of the images in the control for a given item (generate image tags for each).  Is there a way to do this with flow?  Or are there other possible solutions?

1 ACCEPTED SOLUTION

Accepted Solutions
Jay-Encodian
Level 10

Re: Convert Form with Image Gallery to PDF Possibly with Flow

Hey @bigal2019 ,

You could pass the list item ID of the list item containing the attachments in SharePoint and the HTML form data to PowerAutomate and then you can:

  • Convert the HTML to a PDF Document using OneDrive or a third party connector 'Convert HTML to PDF'
  • Use the SharePoint 'Get Attachments' action to get all the attachments from the list item
  • Loop through the attachments collection returned by the SharePoint 'Get Attachments' action and use the SharePoint 'Get attachment content' to get each attachment.
  • Merge the attachments to a PDF document ... you'll need a third party connector for this such as Merge document array to PDF. The Encodian action dynamically works out if a file needs to be converted to PDF prior to merging, so you can just pass the documents (70+ file format supported) and a PDF will be returned

There is an example documented here, albeit this is merging attachments from an email to PDF... however the principles of getting the files and merging are the same: https://support.encodian.com/hc/en-gb/articles/360016980633-Convert-an-Email-Message-including-attac...

HTH

Jay

View solution in original post

9 REPLIES 9
sharonsumner
Level: Powered On

Re: Convert Form with Image Gallery to PDF Possibly with Flow

Hi

 

Depends on your browser but if you are accessing the App in a browser and you can see all the images there then just print screen to pdf? or consider an app page that does the layout and surface that as a link in the App to go to a browser.

 

Sharon

bigal2019
Level: Powered On

Re: Convert Form with Image Gallery to PDF Possibly with Flow

Thanks for the reply.

I was hoping it would be this simple...but I tried adding a scrollable screen with the HTML on it plus an image gallery at the bottom.  When I do a print preview in my browser window, everything gets cut off.  Only 1 page is displayed with the HTML table cutoff and the images missing (they would be on page 2 and 3).  Am I missing something here.

sharonsumner
Level: Powered On

Re: Convert Form with Image Gallery to PDF Possibly with Flow

Hi

 

To get around that I use Chrome and an add in called Full Screen Page Capture - it scrolls the page for you 🙂

 

Sharonimage.png

bigal2019
Level: Powered On

Re: Convert Form with Image Gallery to PDF Possibly with Flow

Thanks - I will look into this.

 

Ideally though, I would like to be able to convert the SharePoint list data with each image attachment to a PDF.  

Jay-Encodian
Level 10

Re: Convert Form with Image Gallery to PDF Possibly with Flow

Hey @bigal2019 ,

You could pass the list item ID of the list item containing the attachments in SharePoint and the HTML form data to PowerAutomate and then you can:

  • Convert the HTML to a PDF Document using OneDrive or a third party connector 'Convert HTML to PDF'
  • Use the SharePoint 'Get Attachments' action to get all the attachments from the list item
  • Loop through the attachments collection returned by the SharePoint 'Get Attachments' action and use the SharePoint 'Get attachment content' to get each attachment.
  • Merge the attachments to a PDF document ... you'll need a third party connector for this such as Merge document array to PDF. The Encodian action dynamically works out if a file needs to be converted to PDF prior to merging, so you can just pass the documents (70+ file format supported) and a PDF will be returned

There is an example documented here, albeit this is merging attachments from an email to PDF... however the principles of getting the files and merging are the same: https://support.encodian.com/hc/en-gb/articles/360016980633-Convert-an-Email-Message-including-attac...

HTH

Jay

View solution in original post

sharonsumner
Level: Powered On

Re: Convert Form with Image Gallery to PDF Possibly with Flow

I totally agree, we have used this method one our our sites using the Encodian tools, there are others too. 

 

Sharon

bigal2019
Level: Powered On

Re: Convert Form with Image Gallery to PDF Possibly with Flow

This sounds like a great option.  Would I need to purchase the third party connector?

Jay-Encodian
Level 10

Re: Convert Form with Image Gallery to PDF Possibly with Flow

@bigal2019 

As you'll need to merge multiple documents into a single PDF you'll need a third party connector... Encodian and Plumsail documents for example both provide a merge action.

Encodian also provide a 'Free' subscription plan which may cover you, if not you would need a paid plan.

HTH

Jay

bigal2019
Level: Powered On

Re: Convert Form with Image Gallery to PDF Possibly with Flow

Thanks - This solution worked.  I used the Encodian "merge document array to pdf" action and added each of my attachments to a document array.  I also have a formatted Word template that I populate with the SharePoint list data ("populate Word template" action).  I merge this document with the image attachments to create my final PDF.  The only challenge I had is that the image files were wider than the 8.5 x 11 PDF document created.  When you scrolled, the were noticeably wider than the first pages.  I used the Encodian "resize an image" action to resolve it.  Looks really good now.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,563)