Convert your source code files into a well-formatted PDF document. Supports selective inclusion based on file names or types and offers blacklist options to exclude specific folders. Perfect for documentation, sharing, or archival purposes.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
This Visual Studio Code extension provides tools for printing your source code files to PDF. Easily convert single files or entire directories of code into professional-looking PDFs right from your favorite IDE.
Prerequisites
Before using the [Your-Extension-Name] extension, ensure you have the following software installed:
For Unix-like systems (macOS, Linux), it's typically pre-installed.
For code stored in Windows systems:
Not supported yet.
Ghostscript: This tool is essential for PDF operations. Check their official website or your system's package manager for installation instructions.
Vim: This is used for syntax highlighting and generating printable files. It's available on most package managers for Unix-like systems. Windows users can download it from Vim's official website.
jq: The jq utility is used here to parse JSON in Bash. It's a lightweight and flexible command-line JSON processor. If not installed, you can get it using package managers like apt, brew, etc.
After installing the required tools, make sure they are accessible from your terminal/command prompt by adding them to your system's PATH.
Features
Print Single File to PDF: Convert the currently open file to PDF.
Print All Source Files in a Directory to PDF: Recursively processes and converts all the source code files in a directory to individual PDFs and can merge them into a single PDF.
Usage
Print a Single File to PDF
Open the file you wish to print in VSCode.
Press Cmd + Shift + P or Ctrl + Shift + P to open the command palette.
Type Print File to PDF and select it.
The converted file will be saved in the root folder of your project.
Print All Source Files in a Directory to PDF
Make sure you're in the directory you wish to process.
Press Cmd + Shift + P or Ctrl + Shift + P to open the command palette.
Type Print All Files to PDF and select it.
All eligible files will be converted and saved in the root folder of your project.
Requirements
The extension assumes that you have vim, gs, and other required tools installed on your system.
Works best on Linux and macOS systems. Functionality on Windows may vary.
Known Issues
[Provide any known limitations or issues here.]
Release Notes
1.0.0
Initial release of the VSCode Print to PDF extension.
Contributing
Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository.
License
[Provide licensing information here, or simply state "MIT License" if it's under MIT.]