Convertify LogoConvertify
how-to

Turning a Plain Text File Into a Printable PDF

Log files, exported notes and code listings print badly straight from a text editor. Converting to PDF first gives you predictable pagination and margins.

By Convertify TeamPublished Last reviewed 5 min read

Written and fact-checked by the Convertify editorial team. We test every workflow on real documents (government forms, design exports, scanned IDs, source code) before publishing — and re-test on each review date to keep the steps current.

Printing a .txt file straight from Notepad or TextEdit is unpredictable. Margins vary by application, long lines get chopped at the page edge instead of wrapping, and page breaks land wherever they land. For a shopping list that is fine. For a log file you need to annotate, or a code listing for a review, or exported notes you want to read on paper, it is not.

Converting to PDF first fixes the layout once, and it then prints the same way everywhere.

Converting

  • Open [Text to PDF](/text-to-pdf).
  • Paste your text, or load the .txt file.
  • Set the font size and page size.
  • Download.
  • The text is laid out with proper margins, wrapped to the page width and paginated automatically. It runs in your browser, so log files and notes containing anything sensitive stay on your machine.

    Choosing a font size

    More consequential than it sounds, because it determines how much fits per line before wrapping.

  • **11-12pt** for prose you will read continuously. Comfortable, roughly 90 characters per line on A4.
  • **9-10pt** for reference material and logs, where you want more on the page and will be scanning rather than reading.
  • **8pt** for dense listings. Legible on paper, tiring on screen.
  • If your content has long lines — log entries, stack traces, wide tables — a smaller size means fewer of them wrap, which makes the output far easier to follow. A wrapped log line splits a single event across two visual rows and makes scanning genuinely harder.

    The line-wrapping problem

    Plain text has no concept of page width. A log line can be 300 characters long. When it hits the page edge it wraps, and now one entry occupies three rows with no visual indication that they belong together.

    Three ways to handle it:

    Reduce the font size so more fits per line. Simplest, and often enough.

    Use landscape orientation if your page size options include it. A landscape A4 page fits roughly 40% more characters per line.

    Pre-process the text to truncate or reformat the long lines before converting. For logs, stripping timestamps or thread IDs you do not need often brings lines under the wrap threshold.

    Code listings

    Text to PDF handles code, with two caveats worth knowing.

    Indentation is preserved as spaces, so structure survives. Tabs may render at a different width than your editor shows — if precise indentation matters, convert tabs to spaces before pasting.

    There is no syntax highlighting. The output is monospaced black text. For a code review on paper that is generally fine. If you want colour, print from your editor or IDE, which will apply its own theme.

    Encoding and special characters

    If your text contains accented characters, currency symbols, or non-Latin scripts, make sure the source file is UTF-8. A file saved in an older encoding — Windows-1252 is the usual culprit — shows mangled characters after conversion.

    Most editors let you check and change this. In Notepad it is in the Save As dialog; in VS Code it is in the status bar at the bottom right.

    Emoji and less common symbols may not render at all, depending on what the PDF's embedded font covers. If a character matters and it comes out as a blank box, replace it with text before converting.

    For structured documents

    If your text is actually Markdown — with headings, lists and emphasis — use Markdown to PDF instead. It renders the structure rather than printing the markup characters literally, which is usually what you want.

    For plain unstructured text, Text to PDF is the right tool and the simpler one.

    Frequently Asked Questions

    What font size should I use converting text to PDF?

    11-12pt for prose you'll read continuously, 9-10pt for logs and reference material where you want more per page. Go smaller if your content has long lines — fewer wrapped lines makes the output much easier to scan.

    Why are my long lines wrapping awkwardly?

    Plain text has no page width, so lines longer than the page wrap wherever they hit the edge. Reduce the font size, switch to landscape if available, or trim unnecessary content from long lines before converting.

    Does it preserve code indentation?

    Yes, indentation is preserved as spaces. Tabs may render at a different width than your editor shows, so convert tabs to spaces first if exact indentation matters. There's no syntax highlighting — the output is plain monospaced text.

    My accented characters came out wrong.

    Your source file probably isn't UTF-8 — Windows-1252 is the usual culprit. Re-save it as UTF-8 in your editor and convert again. Emoji and rarer symbols may still not render if the embedded font doesn't cover them.

    Ready to Try This Tool?

    Put what you learned into action. Try Convertify's free PDF tools now - no sign up required!

    Try Text To Pdf Tool →
    Ad

    Other Tools You Might Need

    Related Articles

    Ad