The Dash Enterprise platform has an API endpoint for creating PDF exports
of your Dash applications. The API is simple: pass in the URL of your
Dash app and the sizing parameters and get back a PDF print out. You can
automate PDF generation with
or you can generate these PDFs on-the-fly.
This API endpoint is used by the Dash Enterprise Snapshot Engine library.
Refer to the
Snapshot Engine documentation
for more examples.
url- The URL to download
appname- Your app’s name.
secret_key- Your app’s secret key. This is needed for authorizing the pdf generation.
wait_selector- A string that specifies a
app.layoutor return it from
dcc.Graphelements on it, then you’ll want
"graph_id"corresponds to the ID of the
.svg-containerrefers to a CSS class of an element that plotly
pdf_options- PDF sizing options. These options are similar to the
pageSize: Predefined page size of the generated PDF. Available options:
Tabloid. Custom page sizes can be
provided with the top level
page_size property (see below).
marginsType: Specifies the type of margins to use.
1 for no margin, and
2 for minimum margin. We
1 and controlling the margins yourself through
your app’s CSS.
This example provides a simple UI around the PDF API. You can run this
example locally or you can deploy this example to Dash Enterprise.
A few things to note:
Plotly helps companies modernize their reporting infrastructure with
Dash. In particular, we help organizations with:
- Our modules for saving and loading reports in Dash Enterprise
- Converting existing PDF reports into Dash application code
- Creating high-quality, branded PDF templates
Get in touch with your sales rep or
reach out to us directly
to learn more.