web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

PDF file after converting HTML not opening.

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Pstork1 Profile Picture
    68,271 Most Valuable Professional on at
    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.

  • Community Power Platform Member Profile Picture
    on at
    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

  • Verified answer
    yashag2255 Profile Picture
    24,695 Super User 2024 Season 1 on at
    Re: PDF file after converting HTML not opening.

    HI @Anonymous 

     

    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! 

  • Pstork1 Profile Picture
    68,271 Most Valuable Professional on at
    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?

  • Verified answer
    Community Power Platform Member Profile Picture
    on at
    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! 

  • yashag2255 Profile Picture
    24,695 Super User 2024 Season 1 on at
    Re: PDF file after converting HTML not opening.

    @Anonymous 

     

    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!

  • yashag2255 Profile Picture
    24,695 Super User 2024 Season 1 on at
    Re: PDF file after converting HTML not opening.

    @Anonymous  @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!

  • Community Power Platform Member Profile Picture
    on at
    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? 


  • yashag2255 Profile Picture
    24,695 Super User 2024 Season 1 on at
    Re: PDF file after converting HTML not opening.

    @Anonymous 

     

    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!

  • Community Power Platform Member Profile Picture
    on at
    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 722 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 461 Moderator

#3
developerAJ Profile Picture

developerAJ 283

Last 30 days Overall leaderboard