Ahmed Moubtahij
Ahmed Moubtahij
SSolara
Created by Ahmed Moubtahij on 9/12/2024 in #questions-issues
rendering pdf
@solara.component
def Page():
solara.use_effect(generate_pdf, dependencies=[])

with solara.Column(style={"height": "100%", "width": "100%"}):
static_pdf= f"/static/{os.path.basename(PDF_PATH)}"
solara.HTML(f'<iframe src="{static_pdf}" style="width:100%; height:100%;"></iframe>')
@solara.component
def Page():
solara.use_effect(generate_pdf, dependencies=[])

with solara.Column(style={"height": "100%", "width": "100%"}):
static_pdf= f"/static/{os.path.basename(PDF_PATH)}"
solara.HTML(f'<iframe src="{static_pdf}" style="width:100%; height:100%;"></iframe>')
I'm running this app in a docker container and exposing it through a port to the browser. Problem: the browser can't find the pdf to render. I thought I'd applied the same logic in https://solara.dev/documentation/advanced/reference/static-files but I seem to be missing something. I have verified that the pdf is correctly generated and in the right path within the container's filesystem. I suspect that there is a path inconsistency when rendering on my host machine's browser. I thought that's what the static/ logic was supposed to solve? Thank you for your time
11 replies