Text & Markdown to PDF
Turn text, Markdown or an HTML file into a clean PDF with real, selectable text, clickable links and bookmarks — Hindi included — without uploading it.
Makes a PDF file from text you type or paste, a Markdown file such as a README, or an HTML file. The PDF is set page by page in your browser with its own fonts: its text can be selected, searched and copied, its links can be clicked, and its headings become the bookmarks a PDF reader lists beside the pages. Hindi and other Devanagari text is shaped as typed, its conjuncts and vowel signs in place.
Printing a page to PDF from the browser gives a copy of the screen, with its headers and whatever the page's print styles allow; this gives a document. Choose Text for notes, logs and letters, where every line should stay as typed; Markdown for a README or anything written with # headings and lists; HTML for a saved web page or an export whose structure matters more than its look.
How to use it
Type or paste into the box, or choose Open file for a .txt, .md, .markdown, .html or .htm file (its encoding is read from a byte order mark or, in HTML, its declared charset). The PDF is made again each time you stop typing, and shown beside the text; Download PDF saves it, named after the file you opened or else the first heading. What you type is kept on this device, so it is there when you come back.
- Format: read from the file's extension, or from pasted text. A whole web page, starting with its doctype or its
<html>,<head>or<body>tag, is HTML. Otherwise two lines that open Markdown blocks, such as a heading, a list item, a code fence or a table's separator row, make it Markdown, even where it starts with HTML as many READMEs do; then text starting with tags is HTML, and anything else Text. Choose another to change it. - Page: A4 (210 × 297 mm), Letter (8.5 × 11 in), Legal (8.5 × 14 in) and A5 (148 × 210 mm); A4 or Letter first, by your country.
- Orientation: Portrait (the default) or Landscape, the page turned on its side for wide tables and long lines.
- Margin: None, 10 mm or 20 mm on every side, 20 mm by default. With page numbers on, the bottom margin is kept deep enough to hold them.
- Font: Sans (the default), Serif or Mono. Code is always set in Mono; choose Mono for logs and anything lined up in columns.
- Size: 10 to 14 pt, 11 by default; headings scale with it.
- Page numbers (on): “3 of 12” centred under each page.
Text keeps every line and blank line; a line longer than the page wraps at a space. A tab moves to the next 4-character column in Mono and is 4 spaces wide in the other fonts. A form feed character starts a new page.
Markdown is read as GitHub writes it: headings, bold, italic, strikethrough, inline code, links, quotes and alerts (> [!NOTE]), bulleted, numbered, nested and task lists, code blocks, tables with their column alignment, rules, images and footnotes, which follow the text, numbered, each reference linked to its note. A link to a heading, such as [Setup](#setup), goes to that heading in the PDF. \newpage or \pagebreak alone on a line starts a new page. HTML inside Markdown is shown as written, except <br>, which breaks the line, and comments (<!-- … -->), which are left out as GitHub leaves them.
Images: images written into the file as data: addresses are included. An image the file names by path, such as img/logo.png, is included once you add that file with Add images, matched by its name. A JPEG goes in as its own bytes and a PNG without loss; GIF, WebP and SVG are drawn as PNG first. Each image is scaled down to the text width where it is wider, and never split across pages.
Examples
A README with headings, links and a footnote
- Markdown
# Field Guide Notes for the [survey team](https://example.org/team). ## Setup - [x] Charge the tablets - [ ] Print the maps[^1] ### Kit list See [Setup](#setup) first. ## Returns [^1]: A3, in colour.
- Title
- Field Guide
- Bookmarks
Field Guide Setup Kit list Returns
The PDF's title is its first heading, and each heading is a bookmark under the one above it. The link to https://example.org/team opens in the browser; [Setup](#setup) goes to the Setup heading. The two tasks are drawn as boxes, the first ticked, and the footnote (“A3, in colour.”) is set after the text, numbered 1, its reference linked to it.
Hindi text
- Text
किराया समझौता मासिक किराया ₹12,000 है।
- Language
- hi
Devanagari is shaped (in Noto Sans with the default font), so the PDF shows the text as typed and copying it gives the same letters back. With most of its letters Devanagari, the PDF says its language is Hindi (hi), which screen readers use.
A log with a tab and a form feed
- Text
Daily log 09:00 Start ␌ Next page
As Text in Mono, “Start” begins at the next 4-character column after the time, and the form feed (shown as ␌) puts “Next page” on page 2. The PDF is named log.pdf, after the file.
Frequently asked questions
\newpage or \pagebreak on a line of its own. In Text, a form feed character does it. Otherwise pages break by themselves: a heading is never left alone at the foot of a page, a paragraph keeps at least two lines together at the foot and head, a table row stays whole unless it is taller than a page, and a table's header row is repeated on the next page.See also
- Markdown Editor — to write Markdown with a live preview before making the PDF.
- HTML to Markdown Converter — to see the Markdown an HTML file becomes, and edit it.
- Image to PDF — to make a PDF from photos or scans instead of text.
- Hindi Typing — to type Hindi in Unicode before making the PDF.