我有一段在Streamlit中生成的Markdown文本,如下所示:
st_md = '''
<b>compare mongodb to other no sql databases</b><br><br><b>Uploaded Files: </b>[]<br><br> Here is a comparison of MongoDB to some other major NoSQL databases:
- MongoDB is a document database. It stores data in flexible JSON-like documents rather than rows and columns like an RDBMS. Other document databases include CouchDB and Amazon DocumentDB.
...
<b>advantages and disadvantages of mongodb to other no sql ds</b><br><br><b>Uploaded Files: </b>[]<br><br> Here are some key advantages and disadvantages of MongoDB compared to other NoSQL databases:
...
'''
我想将st_md
的内容下载为一个PDF文件。我尝试使用download_button方法,但收到错误提示说PDF文件已损坏。我遗漏了什么?
st.download_button(
label="Download data as pdf",
data=st_md,
file_name='test.pdf',
)