Hello Meghal,

My team has actually decided to take a slightly
different route from attempting to convert the
HTML to PDF.  We are generating the files that we
needed to convert directly, using XML files as
templates.

Nonetheless, I think I can give you some advice.

The doc.resetPageCount() simply sets the page
count to zero.  It may, or may not help you. 
Give it a try.

Adding support for the <br /> tag should be
fairly easy.  All you need to do is modify the
SAXmyHtmlHandler class to treat the <br /> tag
just like the SAXiTextHandler class handles the
<newline /> tag.  In fact, since SAXiTextHandler
is a parent of the SAXmyHtmlHander class, you can
get away with adding the following snippet of
code to the SAXMyHtmlHandler.startElement method:

if(name.equals("br")) {
   super.startElement(uri, lname, "newline",
attrs);
   return;
}


Please note that I haven't tested the above code.
 Let me know if it works.

What exactly is the problem that you are having
with the <img> tag?  From the source, it looks
like it should be treated exactly as an iText XML
<image> tag should be treated.  What does your
input HTML look like?

And for the problem you are having with the
content getting chopped off...I cannot tell what
is causing that problem from the source code. 
Could you describe the symptoms a little more?

-Jim

--- Meghal Donde <[EMAIL PROTECTED]> wrote:

> hi jim,
> am using SAXParser and not HTMLParser. 
> PdfWriter.getInstance(document, new
> FileOutputStream("trial1.pdf"));
> 
>             SAXParser parser =
>
SAXParserFactory.newInstance().newSAXParser();parser.parse("file:/home/meghald/trial1/page1.html",
> new SAXmyHtmlHandler(document));
> 
> Thats the code.
> You have used doc.resetPageCount() . wot does
> this do? Will it
> overcome the problem of tackling the pages .As
> in, if the HTML file is
> a long one, will it increase the PDF document
> pages?
> I urgently need to overcome this problem. If
> you have managed
> supporting tags, let me know about it.
> Thank You
> -Meghal
> 






                
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail


-------------------------------------------------------
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl
Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
Camcorder. More prizes in the weekly Lunch Hour Challenge.
Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to