HTML to PDF for a Self-Contained Uploaded File

Drop files here

Convert HTML to PDF from one uploaded .html or .htm file, not a website URL. After explicit approval, TiPDF validates the standalone markup, rejects active or external resources and sends it to the configured Gotenberg Chromium service.

  • Require HTML to PDF upload approval
  • Block scripts and external resources
  • Validate that the returned file is a real PDF

How standalone HTML to PDF works

The HTML to PDF route begins with a file already on the device. It does not accept an address in a URL field, crawl a website, or capture the current tab. Select one .html or .htm, review the remote-processing notice, and approve upload to TiPDF's API.

Server validation decodes UTF-8 and applies restrictive standalone checks. It rejects script, iframe, object, embed, link, and base elements; event handlers; meta refresh; and CSS @import. Resource attributes and CSS url() may use fragment identifiers or data URLs, but external and relative locations are rejected.

After validation, the server renames the file index.html and posts it to Gotenberg's Chromium HTML route. Returned bytes must begin with a PDF signature. This HTML to PDF converter renders a constrained self-contained document rather than executing an arbitrary live site.

An approved uploaded HTML file passing through a secure configured Chromium service into a PDF while URL fetching is blocked

HTML to PDF files, embedded assets, and limits

HTML to PDF accepts one non-empty .html or .htm up to 50 MiB. The API requires Content-Length and rejects oversized multipart requests. HTML is text rather than a binary signature format, so the safety parser and Chromium determine whether markup is usable. Malformed or unsupported input can fail.

Ordinary structure and inline CSS are supported. Images, fonts, or other assets must be permitted data URLs in the same file; separate assets are not uploaded. Relative paths and remote locations are rejected. Fragment-only references pass the safety check, although clickable PDF behavior is not guaranteed.

HTML to PDF needs a valid HTTP or HTTPS GOTENBERG_URL. Timeout is 10–300 seconds, default 120, and conversion requests use a minimum 10-second interval per request key. Service rejection, timeout, missing configuration, or a non-PDF response becomes a visible error.

How to prepare HTML to PDF safely

  1. 1

    1. Save one standalone file

    Create a complete .html or .htm. This is not a URL to PDF field and will not download a site.

  2. 2

    2. Remove HTML to PDF active content

    Delete scripts, frames, embeds, objects, event handlers, meta refresh, link/base elements, and @import rules. A PDF does not need application behavior.

  3. 3

    3. Embed permitted assets

    Convert authorized images and fonts to data URLs where practical. Remove relative and external src, href, and CSS url() references.

  4. 4

    4. Approve HTML to PDF upload

    Select the file, read the notice, and continue only if the configured conversion service is acceptable for its contents.

  5. 5

    5. Convert HTML to PDF

    TiPDF validates restrictions, sends the file to Chromium, and checks the returned signature. Inspect pagination, clipping, fonts, backgrounds, print CSS, and embedded assets.

Suitable HTML to PDF documents

Generated reports

Use HTML to PDF for a single-file status or analytical report with embedded styles and authorized assets. Check tables and page breaks.

Email-style layouts

HTML to PDF can create a fixed document from safe static markup after scripts, tracking URLs, and remote resources are removed. Email-client rendering is not reproduced.

Invoices and receipts

Use the HTML to PDF converter for an internally generated standalone page. Validate amounts, dates, and legal requirements; rendering is not certification.

Design proofs

Review print CSS and static layout in PDF form. A webpage to PDF screenshot of a live URL is different and is not implemented here.

HTML to PDF Chromium rendering boundaries

HTML to PDF uses Gotenberg Chromium to interpret safe markup and CSS inside the file. Print layout can differ from screen layout because of page media, margins, break rules, viewport assumptions, and print color. Data-URL fonts or images can increase size and may fail if malformed.

There is no perfect-fidelity guarantee. Test @media print, fixed positioning, flex or grid breaks, long code, tables, backgrounds, and non-Latin fonts. JavaScript content will not appear because scripts are rejected. External fonts, stylesheets, and images are unavailable, so the source must contain everything essential.

Approved upload and external-resource blocking

The HTML to PDF task uploads the file only after explicit consent, through TiPDF's server to the configured Gotenberg service. It is not a local-only job. The response uses no-store caching, but independently operated infrastructure controls transport, access logs and retention; TiPDF does not make a universal automatic-deletion promise.

Blocking scripts and external or relative resource references reduces unintended network access during rendering, but users must still inspect embedded data and metadata. Do not approve remote conversion when policy forbids it. Closing the page does not erase the source, server logs or downloaded PDF.

HTML to PDF questions and safety limits

Can HTML to PDF fetch a website URL?

No. This route accepts an uploaded HTML or HTM file. URL to PDF capture is not implemented.

Can I save webpage as PDF from a live address?

Not here. Save and sanitize a standalone file first, or use a browser's print function for a page you control.

Can the file load external images or CSS?

No. External and relative references are rejected; permitted assets must be embedded as data URLs.

Does HTML to PDF run JavaScript?

No. Script elements and inline event handlers are rejected before Chromium conversion.

Is HTML to PDF online free?

The page has no checkout, but deployment access and the configured Gotenberg service can vary. Remote approval is required.

Can I upload a folder of assets?

No. The route accepts one file, renamed to index.html for the service.

Will it look exactly like my browser tab?

Not guaranteed. Print pagination, unavailable resources, fonts, and Chromium settings can change the result.

Related PDF tools for the next step

Test method and product notes

HTML to PDF capability copy was verified on July 18, 2026 against the html-to-pdf registry, approval gate, standalone safety scanner, 50 MiB API, Gotenberg Chromium route, timeout and signature check. Claims explicitly exclude URL fetching and active content.

Run HTML to PDF after reviewing the upload

HTML to PDF for a Self-Contained Uploaded File