converting jupyter notebook to PDF in FireFox in Ubuntu 20.04 using pyppeteer

1.3k Views Asked by At

I am shown this option to convert my jupyter to PDF (how should I fix it?) enter image description here

But when I try it, I get the following error: enter image description here

This is rather weird error since I am using Firefox not Chromium browser.

1

There are 1 best solutions below

0
On

As stated in the documentation, https://nbconvert.readthedocs.io/en/latest/install.html#installing-chromium :

For converting notebooks to PDF with --to webpdf, nbconvert requires the Pyppeteer Chromium automation library.

Pyppeteer makes use of a specific version of Chromium. If it does not find a suitable installation of the web browser, it can automatically download it if the --allow-chromium-download flag is passed to the command line.

So, even if you use Firefox for browsing, you need Chromium to convert notebooks to PDF with this exporter based on Pyppeteer (--to webpdf).

You coud also try using --to pdf, which makes the conversion to PDF via LaTeX, but you should have LaTeX installed in your system.

Or you could try notebook-as-pdf (--to PDFviaHTML), but I think it is also based on Pyppeteer.