How do I change pdf page programatically without re-loading?

I’m loading my script thus:

panel serve test_panel.py --port 8081 --autoreload --static-dirs assets=/home/user/Downloads

test_panel.py:

import panel as pn
pn.extension(template='fast')

pageno = pn.widgets.TextInput()
pageno.servable()
pageno.value = '1'

ifname = 'http://localhost:8081/assets/sample.pdf'
pdf_pane = pn.pane.PDF(ifname, width=700, height=1000, start_page=pn.bind(lambda x: int(x),pageno))
pdf_pane.servable()

This works almost as expected, I can type a number in the text box and it changes the page number - but it reloads the pdf file, which can take several seconds. I’d like to just navigate to the right page, not reload. Any ideas?

thanks,

Nawal.

I don’t think it’s possible at the moment. Can you file an issue on Panel?

Do you mean on github?

Yup!

1 Like