iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
You can export a Jupyter notebook as a PDF with nbconvert, a browser, VS Code, or your notebook app’s export menu. Choose the route based on what you already have installed: standard nbconvert --to pdf and VS Code’s direct PDF export need TeX, while nbconvert --to webpdf uses Playwright and Chromium. If you want to avoid TeX—or need to preserve SVG-only plots—export to HTML and print it to PDF from a browser.
Choose a PDF export method
| Method | Rendering route | Main dependency | Best fit |
|---|---|---|---|
nbconvert --to pdf |
LaTeX/XeTeX | A functioning TeX installation, including any required packages and fonts | TeX is already installed, or you need LaTeX templates and controls |
nbconvert --to webpdf |
HTML rendered with headless Chromium | Playwright and its Chromium browser | You want a browser-based command-line export without a TeX toolchain |
| Export HTML, then print | Browser print pipeline | An HTML-capable browser | You want browser print settings or a workaround for SVG-only output in VS Code |
| VS Code Export PDF | Direct PDF export | TeX; SVG-only outputs are not displayed | You already work in VS Code and your outputs suit its PDF route |
| Notebook app Download as / Export | Depends on the frontend and configured exporter | Varies by application and version | You want a one-off export from the notebook interface |
These routes do not all render a notebook the same way. If a PDF loses an output or lays out a table, code cell, or image poorly, try a different rendering path and inspect the resulting pages. The nbconvert command-line documentation describes its PDF and WebPDF exporters; the VS Code notebook guide documents its export behavior and SVG limitation.
1. Convert with nbconvert and LaTeX/XeTeX
Open a terminal in the directory containing the notebook and run:
Recommended Free Tools
jupyter nbconvert --to pdf notebook.ipynb
Replace notebook.ipynb with your file’s name. The PDF exporter uses the LaTeX route with XeTeX. This is a good fit if TeX is already available or if you need LaTeX templates and rendering controls.
#1 Best Overall
A complete TeX environment can be substantial to install. The nbconvert installation guide identifies TeX Live for Linux, MacTeX for macOS, and a LaTeX Project distribution for Windows. Missing packages or fonts can also stop conversion.
If conversion fails
- If the error names a missing executable, check that XeLaTeX is installed and accessible from the terminal where you ran the command.
- If XeLaTeX starts but reports missing packages or fonts, install the required TeX components and retry.
- To inspect or adjust the generated LaTeX, export to LaTeX first and run XeLaTeX manually. The nbconvert usage guide documents the available command-line conversion routes.
2. Convert with nbconvert WebPDF
WebPDF turns the notebook into HTML, then uses headless Chromium to create the PDF. It uses Playwright Chromium rather than a TeX toolchain.
Rank #2
- Install the WebPDF extra:
pip install "nbconvert[webpdf]" - In the notebook’s directory, run:
jupyter nbconvert --to webpdf notebook.ipynb
If Playwright cannot find a suitable browser, nbconvert documents the --allow-chromium-download option. See the WebPDF command-line instructions and the installation guide for setup details.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstall3. Export HTML and print it to PDF
This route avoids a TeX requirement and leaves page layout to the browser’s print controls. It is also the workaround Microsoft recommends for VS Code notebooks with SVG-only outputs.
Rank #3
- Export the notebook to HTML:
jupyter nbconvert --to html notebook.ipynb - Open the generated HTML file in a browser.
- Open the browser’s Print command, choose the browser or operating system’s Save as PDF option, and save the file.
Review the saved PDF for page breaks, wide tables, code wrapping, and image scaling. Browser print settings can change how content fits on a page, so check the actual PDF rather than relying only on the HTML preview.
4. Export a notebook to PDF in VS Code
In the notebook editor, open the main toolbar’s ... menu, choose Export, then choose PDF. Microsoft’s VS Code notebook guide says TeX must be installed for this export.
Rank #4
There is a specific output limitation: SVG-only notebook outputs will not display in the direct PDF. For those notebooks, use the HTML export and browser-print route instead.
5. Use your notebook application’s Download as or Export menu
If your notebook interface offers a PDF option, its Download as or Export menu is the simplest GUI route for an occasional conversion. The exact menu label and whether PDF is available depend on the frontend and its version.
In the Jupyter Notebook web application, the Download as feature is implemented through nbconvert, so the menu is an interface to the conversion backend rather than a separate rendering engine. Its available formats and dependencies can therefore depend on the configured exporters. If PDF is missing from the menu or conversion fails, run an explicit nbconvert command instead. See Project Jupyter’s nbconvert documentation and Jupyter conversion overview.
Why the PDF may look different or omit content
- The export fails before producing a PDF: the selected route may lack its required tools. The LaTeX route needs XeLaTeX and the relevant TeX packages and fonts; WebPDF needs Playwright and Chromium.
- An SVG-only plot is missing from a VS Code PDF: this is a documented limitation of VS Code’s direct PDF export. Export to HTML and print from a browser instead.
- A table, code block, or image is cut off or scaled poorly: the PDF renderer’s page layout differs from the notebook view. Try browser printing for its print controls, then inspect page breaks, wrapping, and image scaling.
- A GUI has no PDF option: the available actions depend on the notebook frontend and version. Use an explicit
nbconvertexporter if it is installed and configured.
Make the output format explicit
Use --to pdf, --to webpdf, or --to html to specify the desired format. The current nbconvert documentation calls for an explicit --to argument, which avoids relying on an implicit default. See the command-line usage guide.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

