Skip to content
Bitavu

PDF TEMPLATES

Convert HTML to PDF with Bitavu Studio

Use Bitavu Studio for HTML to PDF conversion by importing an existing invoice or report layout. You can also start from scratch in the visual editor. Both paths let your app generate PDFs by sending JSON directly to a saved template.

The path from HTML to PDF

Import the HTML template and its placeholders once. After you save the layout in Studio, send the same source fields directly to Bitavu as JSON.

Import the layout once into Studio. For every later PDF, your app sends JSON directly to the saved template.
Read the HTML-to-PDF steps as text
Previous HTML pipeline
Your app fills the placeholders in the HTML template with source data. An HTML renderer turns the resulting page into a PDF.
One-time import into Studio
Import the HTML, CSS and placeholders. Review the layout in Studio’s visual editor and save a template version.
Ongoing Bitavu pipeline
Your app sends JSON directly to Bitavu. Bitavu fills the saved template and returns the PDF.

Start from scratch in the visual editor

Even if you have an HTML template, building the layout directly in Studio can be faster when the import would need substantial adjustments. Use the visual editor to lay out the page, bind JSON fields, and preview repeating rows and page breaks as you work.

Design and test in Studio once. Reuse the saved template with fresh JSON for each PDF.
  1. In Templates, choose New template → Start blank. Name it, select a paper size and orientation, then choose Create template.

  2. Add headings, text and tables in the editor. Bind changing values such as {{customer.name}} to fields in your JSON. For line items, bind a table to a JSON array.

  3. Use Test & preview to try a short example and one with longer text or more rows. Save the version you tested, then generate PDFs in Studio or from your app.

What you can rely on with Bitavu

Spend less time and budget on repeat edits. Update a shared header once when your branding changes, then review and adopt that version across invoices and reports. As your reports grow, combine sections you already maintain, such as a maintenance summary and a checklist.

Give designers and report owners control of the layout. Teammates with editing access can update branding, spacing and page breaks in Studio. Developers manage the data and API connection. Keep layouts, logos and fonts together in your workspace, and send changing values such as customer names and totals as JSON.

Keep production PDFs steady while you improve them. Pin the version your app already uses and test the next one with sample data. If your app follows the latest published version, you can publish compatible layout changes in Studio without an app release. See how to choose a version.

Bitavu generates PDFs without AI and discards render inputs and generated PDFs after processing and delivery. Your saved layouts, assets and example JSON stay in your workspace.

Import HTML and CSS into Studio

  1. In Bitavu Studio, create a report and choose Start from HTML. To bring HTML into a report you already have open, choose More template actions → Import HTML.

  2. Open one of the sample HTML source downloads below in a text editor. Copy its source into HTML + CSS and select Import as editable template. This replaces the report body. Choose Insert into current report to append the imported elements instead.

  3. Review Properties → HTML migration. Check fonts, margins, table columns and page breaks on the canvas. Open Test & preview, choose Temporary test, and paste the matching sample JSON into Test JSON.

Paste the source, including its styles and data placeholders, into the import dialog.

Service invoice with repeating line items

The sample fills in the invoice number with {{invoice.number}} and the customer name with {{customer.name}}. The table reads the items array. Use data-repeat for the array path and data-key for each column’s field. One example row is enough to define the columns.

<table data-repeat="items">
  <thead>
    <tr>
      <th data-key="description">Description</th>
      <th data-key="quantity">Qty</th>
      <th data-key="total">Line total</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{item.description}}</td>
      <td>{{item.quantity}}</td>
      <td>{{item.total}}</td>
    </tr>
  </tbody>
</table>

Try adding a fourth object to items and updating total. Your app supplies the totals and their currency formatting. In our test, the same saved invoice template expanded from one page with three rows to three pages with 34 rows.

Download invoice HTML · Download invoice JSON · Download the sample invoice PDF

The imported invoice in Studio. The Layers panel shows the editable heading, details and line-item table.

Maintenance handover with a separate follow-up page

This report imports two lists and uses placeholders for the site, reference, summary and follow-up notes. The empty element below adds a page break before the follow-up section. You can also add or move a Page break in the Studio editor.

<div data-bitavu-page-break></div>

Change report.followUp in the sample JSON and generate again. The new note appears on the second page. Try a longer summary too and check how it flows before the explicit break.

Download handover HTML · Download handover JSON · Download the two-page handover PDF

Generate a PDF and reuse the saved template

  1. In Test & preview, check the document with the sample JSON and select Generate PDF. For a one-off export from the editor, choose Export → PDF document.

  2. When the layout is ready, select Save changes. To keep a reusable data example with the template, use fictional values in Template example. Temporary test input is separate from the saved example.

  3. Open Use in your app for the request details. Create an API key with Generate PDFs permission and access to this report. Send its templateId, numeric revision, and fresh data from your server to POST https://api.bitavu.com/v1/render. A pinned revision keeps your layout stable while the JSON changes.

For complete integration examples, see the n8n, Node.js and Next.js, or .NET, C# and ASP.NET Core guide.

Troubleshooting HTML to PDF conversion

The imported layout looks different from my page

The importer converts supported HTML and CSS into Studio elements using the screen layout. Review the migration notes for features such as CSS Grid, gradients, shadows, and generated content. Set the paper size and margins in Studio and use explicit page breaks where needed. Print styles such as @page and @media print need manual review.

A logo or font is missing

Scripts and external resources are blocked during import. Embed PNG or JPEG image data in the source or upload the asset in Studio. Check font substitutions in the migration notes and choose an available font in Properties.

My table is empty or a placeholder has no value

Confirm that the JSON uses the same paths and letter case as the placeholders. For a table, check that the array at data-repeat contains objects with the names in data-key. Convert template-engine loops and conditions to Studio’s repeat or condition controls.

Still stuck? Send a small fictional HTML and JSON example with the import message. Contact support.

← All support guides