Now, I want to store/save these charts as tempfile in the work folder to access for the next action that is PDF generator. So, I want to add these charts as Images inside HTML image-holders to create PDF report.
The shared thread is about downloading the plotly chart by user. Where in my case, I want to automate the process of saving the plotly chart as .png in the same folder temporarily for next step use.
I will also look into the shared tread if anything can be tweaked for automation.
Could you share the snippet for using pdfkit to produce an html that reads images from a folder youāre trying to use? There might be 2 things to worry about:
For static image export of plotly I usually go with Kaleido to write in tempfile locally so hopefully that should work for you too
Depending on your code, the way you link to an image in your html template before reading with pdfkit could not work because the work folder is not accessible by the HTML file. This may be a thing to solve by for example saving the temp image in the Streamlit static folder (not sure we need to go as far as this, should depend on your code )
Thanks for you reply and solution!!
However, I shifted from plotly to seaborn and Iām able to save the charts locally in my work folder.
BUT, as you already mentioned, FAILED to load the images into the template html file. I have spent the entire day looking for solution, but no help!!
Also, Im not able to implement the static folder access inside the code. Can you please help on this regard?
Iām using the streamlit app code to test. May I request you if its possible for you to show an example adding image into this same source code please:
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking āAccept allā, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.