Looking for a way to output the main content of my streamlit app to a pdf but have problems trying to look for way so that the output of the print is well formated on the print.
So my application takes in a 4 Data files that are xlsx and then with streamlit automates a report from this. the web view is awsome thanks to the streamlit awsomeness. but I need to export it as a pdf file which the following problem is shown below.
Problems shown.
Sidebar is part of the print and I dont want this (How to remove side bar from the Print )
I want to format the Footer and Header
How to fit each section in to its own page
Really appreciate any suggestions or Links to external resources to assist with this in terms of further readings or Videos that would be helpful to learn how this can be achieved.
@dataprofessor Thanks for taking the time to help me with my question.
Yes i did try that method of hiding the sidebar but still gives me an empty space that eats up one of the pages.
I did find a work around but I am still looking for a solution. I added a st.text_area() and used the height attribute to push the content of the web page down to page 2 and then just did a custom print from 2-4 skipping the first page. that has the white space I create so that the content of the first page starts on the second page.
so this was my work around. but now have another printing problem is that some our the limit of a PDF to be printed can only reach page 5 any thing add beyond this in the streamlit content does not show up , it seems there might be a height limit that can be printed from a streamlit app.
I also have a question about the streamlit content area is that some sort of Iframe , that every time streamlit updates it refeshes the iframe. just wondering. I did see something about a div that was playing with a iframe and also checked that the second problem i might have that the iframe height could be limited to to something around 9000px or a little bit more.
Which i am suspecting could be the problem why the printing cuts off at around that 9000px in height for the full content.
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.