HTML to PDF
Convert your web code into professional documents. Perfect for invoices, reports, and resume builders.
The PDF is laid out on A4 at 718 px wide, whichever preview size you pick. Scripts are not run.
What HTML to PDF does, and which HTML and CSS it handles
The page has two panels. On the left is a plain text editor for HTML, with a sample document already loaded. On the right is a live preview that redraws as you type. When you press Download as PDF, the tool lays your HTML out again on portrait A4 pages, with 1 cm side margins and 1.2 cm top and bottom margins, captures each page with html2canvas at twice screen resolution, and saves the result as Rupix_Export.pdf. Each page is a compressed picture, so the text in the PDF can't be selected or searched. Nothing is uploaded; there is no address field, and the tool only converts the code in the editor.
We ran a test page through it to see what survives. Flexbox and grid layouts, linear gradients, rotated elements, rounded corners, inline SVG, bordered tables, emoji, Hindi text and the ₹ sign all appeared in the PDF as they did in the preview. Modern colour formats such as oklch(), lab() and color() work too: the tool converts them to ordinary RGB colours before capturing, including in gradients, borders and ::before/::after content. Box shadows disappeared, a CSS blur filter was ignored, and @media print rules were not applied.
The PDF layout doesn't depend on the preview size. Your HTML is always laid out 718 pixels wide, the printable width of the page, so 16-pixel text prints at 12 point, the same as a browser's own print. Pages break between lines of text, table rows and images rather than through them, and break-before: page, break-after: page and the older page-break-before: always are honoured. The PDF ends where your content ends: our one-screen demo invoice made a single 42 KB page, and 80 short paragraphs made 3 pages (about 500 KB). Scripts never run, either in the preview or in the export, so pasted code can't act in your browser tab.
How to turn HTML code into a PDF
Paste your markup, check the preview, press one button. Here is each step with a demo invoice.
- 1
Open the HTML to PDF tool
Go to pdf.rupix.io/html-to-pdf. The HTML Editor panel on the left holds a short sample document. The Live Preview panel on the right shows how it renders. The Download as PDF button is at the bottom of the editor panel.

The HTML Editor with the preloaded sample code on the left and its rendered Live Preview on the right. - 2
Clear the sample and paste your HTML
Click CLEAR in the editor's top-right corner, then paste your markup. A full document with a <style> block works, and so does a fragment. Put your CSS in a <style> tag or style attributes. Any <script> in the code is ignored. The preview updates as you type.

A demo invoice's HTML in the editor, with the rendered invoice (red heading, table with rupee amounts) in the Live Preview. - 3
Check the preview at other widths if you like
The three icons above the preview switch between desktop, tablet (450 px) and mobile (320 px) widths, which is useful for checking responsive layouts. They only change the preview. The PDF is always laid out at the page's printable width of 718 pixels, as the note under the Download button says.

The tablet icon selected, with the invoice preview narrowed to 450 pixels so the paragraph wraps onto two lines. - 4
Click Download as PDF
Press Download as PDF under the editor. The button shows "Converting..." while the pages are laid out and captured. Our demo invoice took under half a second.

The Download as PDF button in its faded "Converting..." state. We delayed the exporter's loading to capture it. - 5
Save Rupix_Export.pdf
The "PDF Generated!" screen appears and Rupix_Export.pdf downloads automatically. Every export uses that same name, so rename the file if you make several. Download File saves it again. Process Another File returns you to the editor, and your code is still there.

The PDF Generated! screen showing Rupix_Export.pdf with Download File and Process Another File buttons. - 6
Check the PDF against the preview
Open the file and compare it with the preview. Look for effects the capture can't draw, such as box shadows and blur filters. Our invoice came out as one 42 KB page with the table text sitting where it does in the preview.

Page 1 of the exported invoice PDF: the heading, text and table came through.
100% Client-Side Privacy Guarantee
Unlike other online PDF converters, Rupix operates on a zero-upload architecture. All PDF processing occurs locally in your browser memory using WebAssembly. No document bytes are ever uploaded to any server.
Engine Specifications
Supported Input
HTML and CSS markup
Output Format
Picture PDF (.pdf) — one image per page, text not selectable
Rendering Engine
html2canvas + jsPDF, in your browser
Page Format
Portrait A4 (210mm x 297mm), 1 cm side margins
Layout Width
718 px, whichever preview width you pick
Privacy
No upload — your code stays on your device
Why use Rupix HTML to PDF Converter?
HTML Editor on the left with a Live Preview panel that redraws as you type
Flexbox, grid, gradients, tables, inline SVG, emoji and Hindi text come out as they do in the preview
Laid out on portrait A4 with 1 cm side margins and 1.2 cm top and bottom margins
break-before: page, break-after: page and page-break-before: always each start a new page
Captured with html2canvas and jsPDF in your browser — nothing is uploaded
Scripts in your HTML never run, in the preview or in the export
Frequently Asked Questions
Does this support external CSS libraries or fonts?
Yes. Put your CSS in a <style> tag or in style attributes, and link web fonts such as Google Fonts in the head; your browser fetches them when the page is rendered.
Can I use this to generate invoices and receipts?
Yes. Paste the HTML of your invoice and press Download as PDF; tables, colours and rupee amounts come through as they appear in the preview.
Is my HTML code sent to a server?
No. The page is rendered in your own browser with html2canvas and jsPDF, so your markup and any details in it stay on your device.
What file does the tool produce?
Rupix_Export.pdf every time, so rename it if you make several. The PDF is one picture per page, so the text in it cannot be selected or searched.
Which CSS features work in the exported PDF?
In our test, flexbox, CSS grid, linear gradients, transform: rotate, border-radius, inline SVG, bordered tables, emoji, Hindi text, the ₹ sign and oklch(), lab() and color() colours all came through. Box-shadow was dropped, filter: blur was ignored and @media print rules were not applied. When in doubt, keep styling simple and check the PDF.
Can I control page breaks with CSS?
Yes, for forced breaks: break-before: page, break-after: page and page-break-before: always each start a new page; our three-section test page came out as three pages. Without those rules, the tool fills each page and breaks between lines, table rows or images instead of cutting through them.
How big is the text in my PDF?
The same as a browser print. Your HTML is laid out 718 pixels wide, which is the printable width of an A4 page with 1 cm margins, so 16-pixel text prints at 12 point. The preview width buttons don't change this.
Will the text in my exported PDF be selectable?
No. The PDF contains one picture per page and no text layer, so you can't search, copy or select the words, and screen readers can't read them. If you need real text, use your browser's Print dialog and choose Save as PDF on the HTML file itself.
Is it safe to paste HTML from somewhere else?
Scripts in pasted HTML don't run. The preview and the export both use sandboxed frames with scripts turned off; in our test, neither a <script> tag nor an onerror handler on an image ran. Images and fonts linked from other sites are still fetched by your browser, so avoid pasting code that loads files from places you don't trust.