Hi Paulo

Thanks for your reply. I'll write code to remove the font tags & style tags.

What shall I do about the wide images that are in the html, which are displayed 
truncated in pdf.

Thanks



From: Paulo Soares <psoares <at> consiste.pt>

Subject: Re: pdf conversion from html

Newsgroups: gmane.comp.java.lib.itext.general

Date: 2007-11-06 08:59:25 GMT
 (8 hours and 36 minutes ago)

You are setting the encoding for all the html and are selecting a font 
afterwards that doesn't support it. If it's not the case post the html that 
causes the problem.

Paulo

----- Original Message ----- 
From: "nsk clr" <nskclr <at> yahoo.com>
To: <itext-questions <at> lists.sourceforge.net>
Sent: Tuesday, November 06, 2007 12:05 AM
Subject: [iText-questions] pdf conversion from html

> Hi
>
> I use 'Arial Unicode MS' with 'Identity-H' encoding to convert Html to 
> pdf.
>   Document document = new Document();
>   FontFactory.register("C:\\Windows\\fonts\\arialuni.ttf");
>   StyleSheet st = new StyleSheet();
>   st.loadTagStyle("body", "face", "Arial Unicode MS");
>   st.loadTagStyle("body", "encoding", "Identity-H");
>   st.loadTagStyle("body", "leading", "12,0");
>
>   document.open();
>   ArrayList p = HTMLWorker.parseToList(stringReader, st);
>   for (int k = 0; k < p.size(); ++k) {
>    document.add((Element)p.get(k));
>   }
>   document.close();
>
> In some cases, If the html has font tag and style tag with font (eg. <span 
> style="FONT-WEIGHT: bold; COLOR: rgb(0,153,204)">), I get the following 
> exception.
> ExceptionConverter: java.io.UnsupportedEncodingException: Identity-H
>
> Also when I convert the html with image, the image fills the page 
> widthwise and is truncated on the sides. what should i include for images?
>
> Thanks

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
iText-questions mailing list
iText-questions <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to