2017-08-22 18 views
0

ローカルでのみ実行されるbokehフォルダーアプリケーションでは、Iframe内にPDFを表示しようとしています。次のコードは、実際にiFrameを見せているが、残念ながら、それは常に次の情報のみで満たされている:「404:見つかりません」iframe内にPDFファイルを表示する以外の解決策が同様に歓迎されるだろうbokehアプリケーション内にiframeを埋め込む

from bokeh.models.widgets import Div 
from bokeh.layouts import row 
from bokeh.io import curdoc 

div = Div(text="""<iframe src="path/to/pdf.pdf"></iframe>""", 
      width=300, height=300) 

curdoc().add_root(row(div)) 

答えて

0

カスタムテンプレートを使用してフォルダアプリを試しましたか? MY_APPで

/

あなたが持っている:

my_app/main.py 

my_app/templates/index.html 

index.html

<!DOCTYPE html> 
<html lang="en"> 
    <head> 
    <meta charset="utf-8"> 
    {{ bokeh_css }} 
    {{ bokeh_js }} 
    </head> 
    <body> 
    <iframe src="path/to/pdf.pdf"></iframe> 
    {{ plot_div|indent(8) }} 
    {{ plot_script|indent(8) }} 
    </body> 
</html> 
関連する問題