Jupyter notebook with d3.js content converting to pdf

Hello, I want to generate a jupyter notebook with d3.js content and then convert it to pdf. Furthermore I want to exclude the code written in the jupyter notebook from the pdf and only want a snapshot of the visualization to be remaining.

Is this possible in any way, do I have to search for something else?

Many thanks in advance :slight_smile:

I tried it and what you want is possible but there will be some setting up and avoiding quirks on the way.

If you render the d3.js elements and save them as svg in the notebook, normal pdf should work fine, but if you render HTML like with the d3.js examples i could find, only webpdf will work.

Excluding the code can be done with nbconvert’s --no-input flag, or if only selected code cells should be hidden you need to tag in the cells individually.

1 Like

Thank you very much for helping out :slight_smile:

2 Likes