Output Modes
repo2pdf supports two distinct output modes:- Single PDF - Combines all files into one PDF document
- One PDF per File - Creates a separate PDF for each source file
Single PDF Mode
By default (when “One PDF per file” is not selected), all repository files are combined into a single PDF document.How It Works
Configuration
When using single PDF mode:output.pdf
Features Available
All features work in single PDF mode:- Add line numbers
- Add highlighting
- Add page numbers (only available in this mode)
- Remove comments
- Remove empty lines
Page Numbers
Page numbers are only supported in single PDF mode:File Separation
Files are separated by newlines within the single PDF:Output Example
output.pdf (or your custom filename)
Use Cases
Complete Documentation
Generate a single comprehensive document for reading or sharing
Code Review
Review an entire codebase in one searchable PDF
Archival
Archive a snapshot of your repository in one file
Printing
Print the entire codebase as a physical document
One PDF per File Mode
When “One PDF per file” is selected, each source file gets its own dedicated PDF.How It Works
Configuration
When using one PDF per file mode:./output
File Naming Convention
PDFs are named using the source file’s relative path with path separators replaced by underscores:- Linux/macOS
- Windows
Directory Structure
The output folder is created automatically with all necessary parent directories:Features Available
Most features work in one PDF per file mode:- Add line numbers
- Add highlighting
- Remove comments
- Remove empty lines
- Page numbers are NOT supported (each PDF is typically 1-2 pages)
Document Finalization
Each PDF is finalized immediately after its file is processed:Output Example
./output folder
Use Cases
Selective Sharing
Share individual files without exposing the entire codebase
Modular Review
Review files independently without scrolling through one large document
Parallel Processing
Distribute files to multiple reviewers
Organized Archives
Maintain file structure clarity in the output
Comparison
- Single PDF
- One PDF per File
Advantages
- One file to manage
- Supports page numbers
- Easy to search across all code
- Better for sequential reading
- Smaller total file size
Disadvantages
- Large file size for big repositories
- Harder to navigate to specific files
- Must regenerate entire PDF for updates
Best For
- Complete documentation
- Code reviews of entire projects
- Archival purposes
- Printing
Processing Messages
The output message changes based on the mode:- Single PDF
- One PDF per File
File Count Tracking
The tool tracks the number of files processed regardless of output mode:Memory Considerations
Single PDF Mode
Uses buffered pages to allow page number insertion:One PDF per File Mode
Each PDF is written and closed immediately:For very large repositories (1000+ files), one PDF per file mode is recommended to avoid memory issues.
Choosing the Right Mode
Use Single PDF when:- You need page numbers
- You want one file to manage
- The repository is small to medium-sized
- You need to print or archive the code
- You want easy cross-file searching
- The repository is very large
- You need to share specific files
- You want clearer file organization
- Memory usage is a concern
- You need parallel review workflows
Next Steps
Configuration
Explore all available features and options
Basic Usage
Back to basic usage guide
Local Repositories
Process local repositories