# Convert HTML to PDF

Files are processed on our server, and the results are kept for a few minutes so you can download them, then deleted — whether or not you did. Free, no account, no watermark.

Results are deleted 15 minutes after the job finishes.

## API

POST the file as the raw request body to https://toolsforfree.app/api/jobs?from=html&to=pdf, then

GET https://toolsforfree.app/api/jobs/{taskId}?engine={engine} until state is done,
then GET https://toolsforfree.app/api/jobs/{taskId}/output?engine={engine}&format={format}, with the taskId, engine and format the 202 answers.

Details: https://toolsforfree.app/api.md

MCP: call convert_file at https://toolsforfree.app/mcp with from "html" and to "pdf".

## Options

Sent as JSON in the x-tff-options header. Bounds and allowed values are in https://toolsforfree.app/openapi.json.

- `htmlPdf`: paperSize, orientation, margin, pages, pdfa, background

## Questions

### Does converting HTML to PDF lose quality?

No more than a browser would: the page is drawn by Chromium, the engine inside Chrome, so its layout, fonts and pictures look as they do on screen. Its scripts do not run, and nothing it links to is fetched.

### Can I convert the PDF back to HTML?

Yes, but not as the page it was. The way back reads the PDF's text into a plain web page, line by line, without the pictures, layout or styling the page was drawn with.

### Are linked pictures and stylesheets included?

Only what is inside the file comes across: pictures and stylesheets it links to are not fetched, because the converter has no network access. Pictures embedded in the page itself are kept. A web address cannot be converted either: open the page in your browser, keep a copy with Save page as, and convert that file.

### What can I change about the PDF it produces?

You can choose the paper size, portrait or landscape, the margins, which pages to include, and the page's own background colours and pictures.
