Hi Vivek,
The problem is that the image src path you have given is
a relative. To use this you need to set "img_baseurl"
property in the interface properties.
To do this:
Dictionary<string, object>
interfaceProps = new Dictionary<string,
object>();
interfaceProps.Add("img_baseurl", "Actual
Path to the Image folder");
The interfaceProps variable
should be passed to the HTMLWorker during
parsing of your document.
Regards,
Vaibhav Gupta
Please don't print this
Email unless you really need to - this will preserve
trees on planet earth.
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and
other IT data in
Real-Time with Splunk. Collect, index and harness all the
fast moving IT data
generated by your applications, servers and devices whether
physical, virtual
or in the cloud. Deliver compliance at lower cost and gain
new business
insights.
http://p.sf.net/sfu/splunk-dev2dev
Hi Nurettin,
Thanks for replying. I have checked that, my problem is that I
have a well formed html file and I am reading the file in a
Buffer and
Document document=new Document(PageSize.A4);
PdfWriter.getInstance(document,new
FileOutputStream("Test.pdf"));
document.open();
HTMLWorker htmlWorker = new HTMLWorker(document);
StringBuffer str = new StringBuffer();
str.append("<html xmlns=\
"http://www.w3.org/1999/xhtml\"
xml:lang=\"en\" lang=\"en\"> ");
str.append("<head>
");
..
...
str.append(" <div
class=\"image\">
");
str.append(" <img
src="" width=\"800\" height=\"532\"
alt=\"Display\" />");
str.append(" <br />
");
str.append(" Lorem ipsum dolor sit amet. ");
...
...
str.append("</body>");
str.append("</html>");
htmlWorker.parse(new StringReader(str.toString()));
document.close();
Only the link highlighted in BLUE is not begin displayed, but
an empty-space is displayed for that height and width
mentioned.
Any idea?
Regards,
Vivek
You may look at PdfImageProvider. Basically, it is an
interface that you need to implement to provide iText with the
actual images for a given img URL src and attributes as found
in your source. You can define custom transformations of src
URL in your PdfImageProvider instance.
Nurettin
--
Nurettin DAG
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and
other IT data in
Real-Time with Splunk. Collect, index and harness all the
fast moving IT data
generated by your applications, servers and devices whether
physical, virtual
or in the cloud. Deliver compliance at lower cost and gain
new business
insights.
http://p.sf.net/sfu/splunk-dev2dev