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

PDF file after converting HTML not opening.

Hi guys. 
I've spent the last few hours working on a flow which takes data from Powerapps as an HTML table, and turns it into an HTML File, converting this file to PDF. 
I have the flow executing, I can open the HTML File, however the converted PDF version of the HTML file does not open. 

I have taken the HTML file created through flow, and uploaded it to an HTML to PDF converter to ensure that my HTML is valid. The file created is exactly what I'm looking for. 

Any ideas what this could be? 
Very Strange issue. 

Here are some pictures you may find helpful.

HTML-To-PDF_Flow.PNGConversion.PNGPDF-Error.PNGSuccessful-Flow.PNGFile-Folder.PNGExpected-PDF.PNG

2 ACCEPTED SOLUTIONS

Accepted Solutions
Dual Super User
Dual Super User

Re: PDF file after converting HTML not opening.

HI @RossBroadley 

 

Edit: In the ss i showed the item id selected in the Get File action. It should simply be ID. Please make the change. 

 

Yes. In the attachments part, instead of the path you need to have the attachment content (file content from the sharepoint connector).fhsh.PNG

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS! 

View solution in original post

RossBroadley
Level: Powered On

Re: PDF file after converting HTML not opening.

I'll give this  a go and get back to you. 
I've just seen the get attachments step. Which is new to me! 

Thanks a million! 

View solution in original post

22 REPLIES 22
Dual Super User
Dual Super User

Re: PDF file after converting HTML not opening.

It looks like from your code that you are not appending .pdf to the file name.  I've seen this issue in the past.  Acrobat has an issue trying to open files in SharePoint if they don't have the appropriate file extension.  Make sure you add .pdf to the filename and try again.  The same steps you are using work for me if I add the extension and fail if I don't.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
RossBroadley
Level: Powered On

Re: PDF file after converting HTML not opening.

I appended .pdf to the filename shortly after I made this post as I realised the rookie mistake. (Whoops!)
It's working now. Have the PDF stored in Sharepoint, and it is viewable and downloadable as required! 🙂 

I have one last hurdle however. 
I've added a send email step to the flow, the flow is executing and the email is sending with the required attachment. However the email is corrupted. 
I think I'm doing something wrong with the email step. 

Email-Flow.PNG

Dual Super User
Dual Super User

Re: PDF file after converting HTML not opening.

HI @RossBroadley 

 

Edit: In the ss i showed the item id selected in the Get File action. It should simply be ID. Please make the change. 

 

Yes. In the attachments part, instead of the path you need to have the attachment content (file content from the sharepoint connector).fhsh.PNG

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS! 

View solution in original post

Dual Super User
Dual Super User

Re: PDF file after converting HTML not opening.

Can you explanin a bit more what you mean when you say the email is corrupted?  I would have thought the attachment was a problem because I think you need to supply the same kind of content for the FileContents in the attachment section that you do when you do a create file.  I don't think you can pass it just the path to the file in SharePoint.  Have you considered using the SharePoint Create Sharing Link action instead and just include that link in the body of the email instead of attaching the actual document?



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
RossBroadley
Level: Powered On

Re: PDF file after converting HTML not opening.

I'll give this  a go and get back to you. 
I've just seen the get attachments step. Which is new to me! 

Thanks a million! 

View solution in original post

Dual Super User
Dual Super User

Re: PDF file after converting HTML not opening.

@RossBroadley 

 

In response to the Outlook action error that you posted:

 

This looks like a connection error for the Outlook connector. Can you please delete your current connection to outlook and add a new one? You can add a new connection by clicking the ... on the send an email action and see the connections and add one over there or select your connection appropriately. I have made an update to my previous reply regarding referencing the attachment so please have a look at that too. 

 

Hope this Helps!

Dual Super User
Dual Super User

Re: PDF file after converting HTML not opening.

@RossBroadley  @Pstork1 

 

I was trying to hit the reply button and accidentally hit the mark as solution button. I do not see a way to reverse that. My apologies for the same. 

 

Please mark the post taht answered your query as a solution. 

 

Thanks!

RossBroadley
Level: Powered On

Re: PDF file after converting HTML not opening.

I'm kind of confused here. 
I understand what I'm trying to achieve with the get file content step. 
But it's not allowing me to just select the folder which holds the PDF. 
I dont' want to select a send specific PDF from the folder, I want to send the PDF that was just created as a part of this flow. If that makes sense? 


Dual Super User
Dual Super User

Re: PDF file after converting HTML not opening.

@RossBroadley 

 

In the Get file content step, you do not have to select the folder. If you place the cursor over there, you can choose the ID from the dynamic selector, as shown in the Screenshot below:

hghf.PNG

 

Hope this Helps!

RossBroadley
Level: Powered On

Re: PDF file after converting HTML not opening.

I think I've applied the steps as required. 
Get-File_Content.PNG

I am however still failing to run the flow. But it's now the email step that is failing as follows. 

Email-Error.PNG

Dual Super User
Dual Super User

Re: PDF file after converting HTML not opening.

@RossBroadley 

 

Yes! This is an issue with your outlook connection. I have made a suggestion for this on one of the previous responses. Please have a look. 

RossBroadley
Level: Powered On

Re: PDF file after converting HTML not opening.

Thanks again for all the assistance. 
I've deleted the connection but it's still giving me the same error message.

Dual Super User
Dual Super User

Re: PDF file after converting HTML not opening.

Hey @RossBroadley 

 

Is this flow a shared one? (I mean do you have any co owners for this flow?). 

 

This might also be a caching issue. Can you please save the flow and log out of the current session and close the browser; start a fresh session and run the flow to check if you continue to face the same issue? 

 

Hope this Helps!

RossBroadley
Level: Powered On

Re: PDF file after converting HTML not opening.

This is not a shared flow, I am the sole owner. 

I have logged out of flow, and restarted my computer also to ensure that the cache is fully cleared. 
I am still having the same issue however. 
No change unfortunately .

Dual Super User
Dual Super User

Re: PDF file after converting HTML not opening.

@RossBroadley 

 

Can you please do these: 

1. Click on Data (in the left nav bar on the Flow page) 

2. Click on connections

3. Find the Office 365 Outlook and the Outlook.com connections and delete them. 

4. In your flow, delete the Send email action and add a new Action -> Send an email Office 365 Outllook. -> Sign in and authenticate here to provide a connection. 

5. Run the flow and check if you continue to face the issue. 

 

Hope this Helps!

RossBroadley
Level: Powered On

Re: PDF file after converting HTML not opening.

I have followed your steps above. Ensured that the outlook connections were deleted. 
Deleted the email step, added it again signing in when prompted. 

Still having the same issue. No change in the error whatsoever.

RossBroadley
Level: Powered On

Re: PDF file after converting HTML not opening.

I wonder if sharepoint is confusing things? 
When I had the flow executing successfully I was sending the file from OneDrive. The PDF was corrupted though! 
Really unsure what the issue is here. Ahhh!

Dual Super User
Dual Super User

Re: PDF file after converting HTML not opening.

Hi @RossBroadley 

 

Um no! I have multiple flows based on that pattern. The other actions on the flow are working fine it is just the connection here is what causing a blocker (I might be wrong).  You can test out a theory though, remove all the attachments part from the email action and check if you are able to send an email with a simple body and subject. 

RossBroadley
Level: Powered On

Re: PDF file after converting HTML not opening.

I wouldn't of thought so! Well, it's good to know that everything else is okay. 
I just had a wee test and removed the attachments, and found that issue still persists. 

I wonder if it would be worth starting again. 
Copy all of my expressions and make a fresh flow. 

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
Users Online
Currently online: 373 members 6,244 guests
Please welcome our newest community members: