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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Convert HTML to PDF - ...
Power Automate
Unanswered

Convert HTML to PDF - trouble creating footer by any method

(0) ShareShare
ReportReport
Posted on by 137

Hi there,

 

I have a PowerApp that's taking Sharepoint data from List(s) and creating HTML document (invoice etc) which I'm then passing to a Flow where I save the HTML in OneDrive file and then user Convert HTML to PDF to create and save a PDF file in Sharepoint doc library and all works well .. However ..

 

.. I need to add a footer statement (registered address etc.) in the PDF but know there's no direct way to do that (yes?) so been tryiing various ways in the HTML to achive the same which work fine in the HTML view but when converted to PDF don't .. either by .. using <FOOTER> tag but that doesn't work .. or .. using a <DIV> with style of position:absolute; bottom:0px; but that doesn't work (actually shows at top!) .. or .. setting <BODY> to height:100%;min-height:100% then creating three <DIV> with height 20%/70%/10% effectviely for header/body/footer but that doesn't work as appears correctly (ie. % wise) but with page height looks like about half the size rather than PDF' page height .. few other ways too so ..

 

.. The question is, does anyone know to code the HTML/CSS in such a way as to have a footer at the bottom of the page that appears in the subsequent convert PDF file at the bottom of it's page?

 

Thanks for any help,

 

Derek

Categories:
I have the same question (0)
  • jhall Profile Picture
    636 on at

    I don't have an answer, but the issue made me curious.  I did a quick gut-check on wkhtmltopdf (which might be the underlying open source code being used to generate the PDF) and it does not properly handle the HTML5 "footer" value.  So, if I were hazarding a guess that could be related.  Knowing what's doing the conversion under the hood could be key to figuring out if it really can be done at all.

     

    If this were my problem to solve, I would consider writing my own app/service to do this.  I did something similar for merging SharePoint data with PowerPoint data fields (search/replace) so that slide decks were auto-generated when new items were added to meeting agendas.  If you include the Flow SFTP service connector (if your org allows it) to push/pull files to pretty much any system, this opens you up to having the documents batch processed by anything and doesn't restrict you to the existing tools within Flow.

  • Jay-Encodian Profile Picture
    2,920 on at

    Hi @DerekPapworth,

     

    The Encodian connector provides the 'Add HTML Header or Footer' action which you can use to overlay an existing PDF document. - https://support.encodian.com/hc/en-gb/articles/360013808614-Add-HTML-Header-or-Footer 

     

    This should cover your requirements? 

     

    If you could share the source HTML, I'll try to see why the OneDrive coversion doesn;t convert the HTML correctly.

     

    HTH

    Jay

  • Verified answer
    DerekPapworth Profile Picture
    137 on at

    Thanks both @jhall and @Jay-Encodian for thoughts and options

     

    I was needing a quick'est solution so in the end I've just played with relative positioning trial and error for this particular document format so that's sorted for that but still would like a generic "trailer" type option.

     

    Coding an convertor myself is one option @jhall but time is the contsraint on that one amd Encodian could well do the job but it's a cost option (although looks reasonable) and this is for charity so trying to use standards in Flow etc., as they get whole Office 365 for free.

     

    Thanks though!

  • jhall Profile Picture
    636 on at

    Glad you were able to hack something together.  I'm very happy w/ most of the standard methods on Flow, but my own experience was similar w/ the PPT/SharePoint merge.  However, it did allow me to do some standard methods for "punting" so I could use any number of tools to solve a particular issue.

  • Jay-Encodian Profile Picture
    2,920 on at

    Hey @DerekPapworth

     

    Good stuff, glad you solved it.

     

    There is a free SKU, and if it's for charity then we'd have loved to have helped FOC.

     

    Cheers Jay

  • anton-khrit Profile Picture
    197 on at

    Hi!

     

    You can use "Convert HTML to PDF" action from Plumsail Documents connector.

     

    It allows you to specify Footer and Header HTML. Please review parameters in the documentation.

     

    Note, it is a paid solution.

     

    convert-html-to-pdf-example.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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard