在jupyter笔记本中,可以显示本地pdf,例如
from IPython.display import IFrame
IFrame("./path/to.pdf", width=600, height=300)
但是,在JupyterLab中,这只是创建一个空框架并引发警告
renderers.js:430 Resource interpreted as Document but transferred with MIME type application/pdf
然后是错误
Failed to load 'http://localhost:8888/files/path/to.pdf?1554301584935' as a plugin, because the frame into which the plugin is loading is sandboxed.
是否可以通过在JupyterLab中将路径传递给python函数来显示本地PDF?