Reputation: 3960
I want to convert an html string to a .rtf file. when i do something like this.
Document doc = new Document();
RtfWriter2.getInstance(doc, out);
HtmlParser hp = new HtmlParser();
hp.go(doc, in);
I get an exception saying:
<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)
This because i have an image inside html can the path is relative.
Is there a way to set the basepath or a way to do my job?
Upvotes: 1
Views: 987
Reputation: 537
The problem lies in your HtmlParser. The parser should check the source attributes for relative paths and supplement them with the site host. Then you can download the images seperatly from the HTML DOM tree.
Upvotes: 2