Ask AI
Skip to main content

Convert html to pdf

Function: Convert HTML to PDF

This function allows you to transform any HTML content into a PDF document. It's perfect for generating reports, invoices, or any other document that needs to be presented in a standardized, printable format from web-based content.

Input

  • HTML: The actual HTML code (as a piece of text) that you want to convert into a PDF.
    • Type: STRING

Output

  • Output: The generated PDF file. This file will be stored in a variable that you can then use in other parts of your application, for example, to attach to an email or allow users to download. By default, this variable will be named PDF_FILE, but you can choose a different name.
    • Type: FILE

Execution Flow

Real-Life Examples

Here are some practical ways you can use the "Convert HTML to PDF" function:

  1. Generate a Simple Web Page as a PDF:

    • Inputs:
      • HTML: <h1>Welcome to My Site!</h1><p>This is a simple page converted to PDF.</p>
    • Result: A PDF file named PDF_FILE is created, containing the "Welcome to My Site!" heading and the paragraph text. You can then offer this PDF for download.
  2. Create a Dynamic Invoice for a Customer:

    • Inputs:
      • HTML: (A variable containing HTML code for an invoice, which has been dynamically populated with customer details and order items from your database)
      • Output Variable Name: CustomerInvoice
    • Result: A PDF file named CustomerInvoice is generated, showing the complete invoice for a specific customer. This PDF can then be automatically emailed to the customer.
  3. Produce a Monthly Sales Report:

    • Inputs:
      • HTML: (A variable holding the HTML structure of a sales report, filled with data like sales figures, product lists, and charts generated from your application's data)
      • Output Variable Name: MonthlySalesReport
    • Result: A PDF file named MonthlySalesReport is created, containing all the detailed sales information. This PDF can be saved to a cloud storage service or sent to stakeholders.