# PDF generation without code cells

**URL:** <https://swan-community.web.cern.ch/t/pdf-generation-without-code-cells/458>\
**Category:** Jupyter Notebooks\
**Created:** [July 20, 2021, 9:23am UTC](https://swan-community.web.cern.ch/t/pdf-generation-without-code-cells/458 "2021-07-20T09:23:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![egibbons](https://swan-community.web.cern.ch/letter_avatar_proxy/v4/letter/e/ecccb3/32.png) [@egibbons](https://swan-community.web.cern.ch/u/egibbons)\
**Post date:** [July 20, 2021, 9:23am UTC](https://swan-community.web.cern.ch/t/pdf-generation-without-code-cells/458/1 "2021-07-20T09:23:29Z")

</div>

Hi,

Scrolling through previous posts on PDF saving I have not been able to find how to export a notebook without the code cells. I would only like to have markdown cells and outputs in the generated PDF file if possible.

Thank you in advance,

Eddie

---

<div class="post-metadata">

**Author:** ![etejedor](https://swan-community.web.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://swan-community.web.cern.ch/u/etejedor)\
**Post date:** [July 21, 2021, 8:54am UTC](https://swan-community.web.cern.ch/t/pdf-generation-without-code-cells/458/2 "2021-07-21T08:54:03Z")

</div>

Hi,

I think you can use `nbconvert` for that:

[https://nbconvert.readthedocs.io/en/latest/config\_options.html](https://nbconvert.readthedocs.io/en/latest/config_options.html)

It’s just a matter of finding the right configuration options (e.g. `PDFExporter.exclude_code_cell`)

---

<div class="post-metadata">

**Author:** ![egibbons](https://swan-community.web.cern.ch/letter_avatar_proxy/v4/letter/e/ecccb3/32.png) [@egibbons](https://swan-community.web.cern.ch/u/egibbons)\
**Post date:** [July 22, 2021, 7:46am UTC](https://swan-community.web.cern.ch/t/pdf-generation-without-code-cells/458/3 "2021-07-22T07:46:38Z")

</div>

Hi,

Thank you for your reply. I will test this with the correct configuration.

---

<div class="post-metadata">

**Author:** ![dalvesde](https://swan-community.web.cern.ch/letter_avatar_proxy/v4/letter/d/db5fbb/32.png) [@dalvesde](https://swan-community.web.cern.ch/u/dalvesde)\
**Post date:** [June 9, 2023, 10:31am UTC](https://swan-community.web.cern.ch/t/pdf-generation-without-code-cells/458/4 "2023-06-09T10:31:45Z")

</div>

Hi,  
This thread is old already, but I got the impression this didn’t get a final solution.  
So here it is:

```auto
jupyter nbconvert --to pdf --no-input Untitled.ipynb

```

Cheers,  
Diogo
