簡體   English   中英

iText html字符串到.rtf文件

[英]iText html string to .rtf file

我想將html字符串轉換為.rtf文件。 當我做這樣的事情。

Document doc = new Document();
RtfWriter2.getInstance(doc, out);
HtmlParser hp = new HtmlParser();
hp.go(doc, in);

我有一個例外說:

<ExceptionConverter: java.io.FileNotFoundException: 
C:\Users\ddarellis.OTS\AppData\Roaming\JDeveloper\system12.1.3.0.41.140521.1008\DefaultDomain\resources\images\thyreos.jpg 
(The system cannot find the path specified)

這是因為我在html內可以插入圖像是相對路徑。

有沒有辦法設置基本路徑或完成我的工作?

問題出在您的HtmlParser。 解析器應檢查相對路徑的源屬性,並使用站點主機對其進行補充。 然后,您可以從HTML DOM樹分別下載圖像。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM