Skip to main content

Code to PDF

Turn source files into syntax-highlighted PDFs with line numbers.

No watermarkFree & unlimitedRuns in your browser

Input

Theme

Page size

Font size

Line numbers

No files yet

Your source files stay on your device — highlighted and packaged locally in your browser.

About Code to PDF

Code to PDF turns pasted code or one or more text source files into syntax-coloured, image-based PDF pages. Uploads are limited to 1.5 MB per source file. The interface offers auto-detection plus 20 named language choices, A4 or Letter, Light, Stone or Solarized themes, 10–14 point type and optional line numbers. Uploaded filenames are rendered as section headers; there is no custom header, footer, orientation or wrap control.

Code to PDF specs

Key facts about Code to PDF on PDFChamp
PriceFree ($0) — no paid tier
AccountNot required
WatermarkNone
Where it runsIn your browser, on your device
File uploadNo file is uploaded
InputSource-code and text files, up to 1.5 MB each (1 or more files)
OutputPDF
File size limit1.5 MB per source file; beyond that, your device's memory
Offline useMay work after all required code and assets have loaded; browser caching is not guaranteed

How to use Code to PDF

  1. Choose an input mode

    Upload text source files of at most 1.5 MB each, or paste one snippet.

  2. Choose highlighting

    Auto-detect is available, or select one of the named languages in paste mode and per uploaded file.

  3. Set the appearance

    Pick Light, Stone or Solarized, A4 or Letter, a 10, 11, 12 or 14 point font, and show or hide line numbers.

  4. Download

    Press Download PDF. Each source is rendered with its filename header and sliced across image-based pages in code.pdf.

Frequently asked questions about Code to PDF

What happens above 1.5 MB?

The file is marked too large and excluded from the generated document. Split the source into smaller text files or paste a smaller excerpt.

How many languages can I select explicitly?

The picker lists JavaScript, TypeScript, Python, Ruby, Go, Rust, Java, C, C++, C#, Swift, Kotlin, Shell, YAML, JSON, HTML, CSS, SCSS, Markdown and SQL, plus Auto-detect. Auto-detection may recognise additional highlight.js grammars, but they are not manual picker options.

Is the code searchable?

No. Highlighted HTML is captured to PNG slices and embedded in the PDF. Even the filename header is part of that raster capture.

Why in-browser processing matters

Every PDFChamp tool runs inside this page: the file you choose is read by JavaScript in your own browser and is never sent to a server, so nothing is uploaded, queued, or stored anywhere. That removes the upload wait, the processing queue, and the question of what happens to your file afterwards — the PDFChamp overview compares this architecture with server-side PDF tools.

Last updated

Related tools