Your first conversion
Let’s convert a GitHub repository to PDF using the fastest method. This guide will have you generating your first PDF in under a minute.Choose repository source
You’ll be asked whether to use a local repository:
- Select No to clone from GitHub
- Select Yes to convert a local directory
Provide repository URL
If you selected a remote repository, enter the GitHub URL:Or if using a local repository, provide the full path:
Select features
Choose the features you want to include using the space bar:
Add line numbers
Adds line numbers to the left of each code line
Add highlighting
Applies syntax highlighting using highlight.js
Add page numbers
Includes “Page X of Y” at the bottom of each page
Remove comments
Strips code comments from the output
Remove empty lines
Removes blank lines to create more compact output
One PDF per file
Creates separate PDFs for each file instead of one combined PDF
Name your output
Specify the output file or folder name:For single PDF mode:For one PDF per file mode:
Keep or delete clone
For remote repositories, decide whether to keep the cloned repository:
Keeping the repository allows you to regenerate the PDF with different settings without re-cloning
Example: Converting repo2pdf itself
Here’s a complete example converting the repo2pdf repository:Understanding the output
Single PDF mode
When generating a single PDF, repo2pdf creates one document containing all files from the repository:- Each file starts with its relative path as a heading
- Files are separated by page breaks (when needed)
- Syntax highlighting is applied based on file extension
- Line numbers and page numbers are added if requested
One PDF per file mode
When using “One PDF per file”, repo2pdf creates a directory structure:Customizing ignored files
By default, repo2pdf ignores common files likenode_modules, .git, and binary files. To customize this, create a repo2pdf.ignore file in your repository root:
repo2pdf.ignore
For local repositories, place the
repo2pdf.ignore file in the repository root. For remote repositories, the ignore file must be committed to the repository.Tips for best results
Use syntax highlighting
Always enable syntax highlighting for code repositories - it dramatically improves readability
Add line numbers
Line numbers make it easier to reference specific code sections in discussions
Remove comments for summaries
Use “Remove comments” when creating condensed overviews of large codebases
One PDF per file for large repos
For repositories with 100+ files, consider using one PDF per file for easier navigation
Common workflows
Code review preparation
Code review preparation
Generate a PDF with line numbers and syntax highlighting:Share the PDF with reviewers who can annotate and reference specific line numbers.
Portfolio documentation
Portfolio documentation
Create a clean PDF without comments for project showcase:
Code archival
Code archival
Archive a snapshot with all details:
AI training data preparation
AI training data preparation
Generate multiple PDFs for document processing: