PDF is a library for managing PDF documents.

It provides an easy method of generating a PDF document from an HTML formatted template file.


Robot Framework

<p>Thank you for the order.</p>
    <h3>Name: {{name}}</h3>
    email: {{email}}
    zip: {{zip}}
*** Settings ***
Library    RPA.PDF

*** Variables ***
${TEMPLATE}    order.template
${PDF}         result.pdf
&{VARS}        name=Robot Generated
...            zip=00100
...            items=Item 1, Item 2

*** Tasks ***
Create PDF from HTML template
    Template HTML to PDF   ${TEMPLATE}  ${PDF}  ${VARS}


from RPA.PDF import PDF

p = PDF()
orders = ["item 1", "item 2", "item 3"]
vars = {
    "name": "Robot Process",
    "email": "",
    "zip": "00100",
    "items": "<br/>".join(orders),
p.template_html_to_pdf("order.template", "order.pdf", vars)

API Documentation

  • Robot Framework API
  • Python module API