【发布时间】:2021-08-07 04:11:04
【问题描述】:
我正在尝试加载引用子目录中图像的 HTML 文件。这是结构: 基本上,BrowserFrame 无法加载 Overview_files 下的图像。如果我直接从桌面加载它就可以正常工作。
这是 HTML 代码的 sn-p:
<p class="MsoNormal" style="margin-top:0in;margin-right:0in;margin-bottom:0in;
margin-left:.75in;margin-bottom:.0001pt">
<span style="mso-no-proof:yes">
<!--[if gte vml 1]><v:shape
id="_x0000_i1069" type="#_x0000_t75" style='width:1075.8pt;height:120pt;
visibility:visible;mso-wrap-style:square'>
<v:imagedata src="Overview_files/image003.png" o:title="" cropright="-6f"/>
</v:shape><![endif]--><!--[if !vml]-->
<img border="0" width="1434" height="160" src="Overview_files/image004.gif" v:shapes="_x0000_i1069">
<!--[endif]-->
</span>
</p>
这是我使用的 Vaadin 代码:
helpDoc = new BrowserFrame();
docResource = new FileResource( docFile ); // docFile is full path to file on disk, as a File
helpDoc.setSource(docResource);
我应该以不同的方式加载本地 HTML 文件吗?我看到一篇较早的帖子(2015 年,非常过时),其中一个人暗示他将其加载到 ZIP 文件中,但我不确定他是如何做到的。
【问题讨论】: