Export to pdf

Summary

how to export streamlit page as it is to PDF

Steps to reproduce

Expected behavior:

export the streamlit page as it is with all the styles and elements
Actual behavior:

N /A

Additional information

If needed, add any other context about the problem here.

Print → Save as PDF

hey i tried it with print as PDF but it cuts the page and i cant use the exported PDF this way…

is there way to tell to PDF when to “break” page?

Hi @nikmere you can try to use css “hack”. This works quite well for page breakes in chrome (I wanted to breake pages after horizontal rule)

st.markdown(
    """
    <style type="text/css" media="print">
      hr
      {
        page-break-after: always;
        page-break-inside: avoid;
      }
    </style>
""",
    unsafe_allow_html=True,
)

it didnt solve the problem…it still breaks the pdf

Hi @nikmere could you share your repo? Without any code it is hard to guess what is happening and braeking :slight_smile:

For above solution you obiously need to add horizontal lines in your code for example using st.markdown("---")