When the user does click on the “download pdf” button, it will take all the content inside of the dashed border;
I read a lot of topics and questions about it but no one seems working as I need… I found alternatives that transform only the Plotly Chart into a .pdf file, but not the entire content div.
Any help or suggestions are very welcome and I will appreciate it a lot to know alternatives to solve this problem (even React components that could be it).
I’ve also searched for this and haven’t found a good solution. (Well, other than Dash Enterprise ).
But here is something that may work depending on how an app is designed. It’s a simple clientside callback that opens the browser’s Print Dialog Box, which lets the user select printing options - including saving as a PDF.
Since it’s necessary to have an Output for a Dash callback, I just selected some unused parameter for the dummy output - in this case I used the title parameter of the html.Button .
It would be nice to be able to set defaults for the print dialogue options, like include Background Graphics and exclude Headers and Footers. But apparently these things aren’t part of a standard API for browsers (yet?). Some options like margins, page orenientation etc can be set with css.
I know this isn’t exactly what you are looking for, but others may find it helpful.