PDF¶
- marimo.pdf(src: str | io.IOBase, initial_page: int | None = None, width: int | str | None = '100%', height: int | str | None = '70vh', style: dict[str, Any] | None = None) Html ¶
Render a PDF.
This currently uses the native browser PDF viewer, but may be replaced with a custom viewer.
Example.
mo.pdf( src="https://arxiv.org/pdf/2104.00282.pdf", width="100%", height="50vh", ) with open("paper.pdf", "rb") as file: mo.pdf(src=file)
Args.
src
: the URL of the pdf or a file-like objectinitial_page
: the page to open the pdf to. only works ifsrc
is a URLwidth
: the width of the pdfheight
: the height of the pdf. for a percentage of the user’s viewport, use a string like"50vh"
style
: a dictionary of CSS styles to apply to the pdf
Returns.
Html
object