Text to PDF
Convert notes, code or Markdown into a tidy PDF.
Updated
Add your files
TXT, MD, LOG, CSV, JSON
How to convert text to PDF
- 1
Add .txt, .md, .log, .csv or .json files, one or many. Each becomes its own PDF.
- 2
Keep Interpret Markdown on to turn headings, lists and emphasis into formatting. Pick the Font (Sans serif, Serif or Monospace), a Font size between 6 and 24 points, the Page size (A4 or Letter) and whether to Add page numbers.
- 3
Press Convert text to PDF. The pages are laid out in your browser and the result names anything that could not be written.
- Use Text to Word when the text still needs editing: the same files become a .docx there.
- Use HTML to PDF when the file is a saved web page rather than plain text or Markdown.
What the page looks like
Text is set at the Font size you choose, 11 points by default, with lines spaced at 1.35 times the size, inside margins of 54 points (three quarters of an inch) on A4 or Letter. Headings from Markdown are bold at 20, 15.5, 13 and 11.5 points whatever the body size, lists are indented with bullets or numbers, pipe tables become ruled tables with a shaded header row, and a fenced code block becomes shaded lines in Courier at 92% of the body size. Add page numbers prints "3 / 12" centred at the foot of each page in 9 point grey.
CSV, JSON and log files
A .csv becomes one table with its first row as the header, repeated at the top of every page it runs onto; columns are sized to their content, and a table too wide for the page is printed in parts of consecutive columns with a note. A .json or .log file is printed as code, line by line, with each tab shown as four spaces. A table too long for 1,000 pages is refused before anything is laid out, with its row count in the message.
Questions about Text to PDF
When is a file treated as Markdown?
When Interpret Markdown is on and the file is a .md, or its text starts with a heading of one to three # marks or has a line that starts with - or *. Other text becomes paragraphs split at blank lines. A .json or .log file, and any other file that is not read as Markdown when Monospace is chosen, is set as one block of code instead: every line as written, in Courier on shaded lines, with long lines wrapped rather than re-flowed.
Why did some characters become question marks?
The PDF uses the built-in Helvetica, Times and Courier faces, which write Western European text. When the text holds other letters, Liberation Sans is embedded, which covers Latin, Greek and Cyrillic; a Serif or Monospace run that Times or Courier cannot write is set in Liberation Sans too, and the result says so. Characters outside those scripts, such as Devanagari, Arabic, Chinese or emoji, cannot be written: each becomes "?" and the result counts them.
Is there a size limit?
A document that would run past 1,000 pages is refused with a message, because every page is held in memory until the file is written; split the text and convert the parts. For a CSV that is too long, the message suggests CSV to Excel instead.
Advertisement