Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Code to PdfNew to Visual Studio Code? Get it now.

Code to Pdf

herzogmatthias

|
1,537 installs
| (1) | Free
Generate a Pdf from Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Code to PDF


:warning: If you are using Firefox: Have a look at the known issues here

This extension can be used to convert your code into a PDF File like it works with IntelliJ. It works with single code files as well as with whole Directories. It uses puppeteer-core under the hood so you need Firefox or Chrome installed.

Features

  • Convert whole directories or single files of code into PDFs.
  • Syntax Highlighting thanks to Prism.js for every major language.
  • easy to use via commands or the explorer context menu.

Extension Settings

This extension contributes the following settings:

  • codeToPdf.openHTMLPageInBrowser
    • default: false
    • opens a browser window with the html which will be converted to pdf
  • codeToPdf.ignoredFileExtensions
    • default: [".txt", ".pdf",".jpg",".jpeg",".png",".xlsx",".docx",".pptx",".ico"]
    • Stores file extensions which will be ignored when converting to pdf e.g. ['.html']
  • codeToPdf.pathForBrowserExec
    • default: ""
    • Usable for MacOS Users when the Browser is not installed in the default location

Release Notes

Known Issues when using Firefox

  • Firefox cannot be closed with puppeteer: Because of a locked user profile puppeteer cannot close firefox. The task has to be cancelled manually.
  • PDF colors can look blurred: The converted PDF can looked blurred. A workarround is to enable the openHTMLPageInBrowser option and convert it manually.
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft