Pdf

Download this notebook from GitHub (right-click to download).


import panel as pn

pn.extension()

The PDF pane embeds an .pdf document in a panel if provided a local path, or will link to a remote file if provided a URL.

Parameters:

For layout and styling related parameters see the customization user guide.

  • embed (boolean, default=False): If given a URL to a file this determines whether the image will be embedded as base64 or merely linked to.

  • object (str or object): The PDF file to display. Can be a string pointing to a local or remote file, or an object with a _repr_pdf_ method.

  • style (dict): Dictionary specifying CSS styles


The PDF pane can be pointed at any local or remote .pdf file. If given a URL starting with http or https, the embed parameter determines whether the image will be embedded or linked to:

pdf_pane = pn.pane.PDF('https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf', width=700, height=1000)

pdf_pane

Like any other pane, the PDF pane can be updated by setting the object parameter:

pdf_pane.object = 'http://www.africau.edu/images/default/sample.pdf'
This web page was generated from a Jupyter notebook and not all interactivity will work on this website. Right click to download and run locally for full Python-backed interactivity.

Download this notebook from GitHub (right-click to download).