Why turn code into a PDF?
Code is easiest to read in an editor, but an editor isn't always there. Students hand in assignments as PDFs, reviewers mark up printouts, and teams keep a copy of the exact source that shipped. A PDF opens on any phone or computer, looks the same everywhere, and can be printed, shared or archived without anyone needing your project set up.
This converter keeps code looking like code: a clear monospace font, syntax colours, line numbers and the file name at the top of every page. If you want the finished web page rather than its source, use HTML to PDF instead.
Real text, not screenshots
Many tools print code as pictures, which makes the PDF large and impossible to search. Here every character is real text in an embedded font. You can search for a function name, select a few lines and paste them into your editor with the indentation intact. Line numbers are drawn in the margin and are left out when you copy, so the snippet works straight away.
Tabs are turned into spaces at the tab width you choose, so columns line up exactly as in your editor. Comments in Urdu, Arabic and other languages are kept with a matching fallback font.
Settings explained
- Theme: Light, GitHub Light or Solarized Light for paper, or Dark for reading on screen. The dark theme fills each page with colour, so avoid it if you print.
- Font size and line numbers: from 6 to 14 points, with numbers on or off.
- Long lines: wrap onto the next row with a small arrow, or shrink the text of that file until the longest line fits.
- Page: A4 or Letter, portrait or landscape, with narrow, normal or wide margins. Landscape suits code with long lines.
- Header and footer: the file name at the top, “Page 1 of N” at the bottom, and the date if you like.
Several files and whole folders
Add as many files as you need, or upload a folder. Files are sorted by path, and each keeps its folder in its title, such as src/utils/date.ts. Folders such as node_modules and .git are skipped, as are pictures and other files that aren't text.
Choose One PDF to get a single document that starts with a clickable contents page. Each file begins on a new page and has its own bookmark, so you can jump straight to it in any PDF reader. Choose Separate PDFs to get one PDF per file, packed in a ZIP with the same folders. Afterwards you can merge PDFs, compress a large one, or add a password.
Private and safe
Your files never leave your device. They are read by your browser and never uploaded. The code is only coloured, never run, so even a script you don't trust is safe to convert. A large file is handled in the background, so the page keeps working while the PDF is made.