Open In App

How to convert IPython notebooks to PDF and HTML?

 In this article, we will see how to convert IPython notebooks to PDF and HTML. Sometimes according to our necessity, we would want to share or convert the Jupyter notebook to HTML or pdf format. Our Jupyter Notebooks can be easily converted to PDF and HTML files. You may access your notebook as a PDF with only a few simple steps.

Stepwise Implementation

Step 1: Open Jupyter notebook in the browser, our menu bar of the Jupyter notebook looks like this:



 

Step 2: The following packages must be downloaded, we can download them via the Jupyter notebook itself by using this command:

!pip install -U notebook-as-pdf
!pyppeteer-install

Step 3: To convert the python notebook to pdf or HTML we’ve to follow this path:



To convert into HTML file’

file ->  Download as -> HTMl(.html)

To convert into a pdf file.

file ->  Download as -> PDF via HTML(.pdf) or PDF via pyppeteer(.html)

 

Output:

The converted PDF file:

 

The converted HTML file:

 

Article Tags :