Hello Meghal,

I don't have the solutions to the problems you've
presented, but I'm willing to work with you to
come up with a solution.  I too need to convert
HTML to PDF, and will probably end up trying to
overcome the same limitations.

I do need a bit of help getting started, however.
 No matter what HTML input I pass to the
HTMLParser, when I call the .close() method on my
document I get a:

ExceptionConverter: java.io.IOException:
The document has no pages.
at com.lowagie.text.pdf.PdfPages.writePageTreeat
at com.lowagie.text.pdf.PdfWriter.close
at com.lowagie.text.pdf.PdfDocument.close
at com.lowagie.text.Document.close

I can, however create a PDF by manually adding
content.  It's as if the parser isn't parsing the
HTML at all.  I know I'm close, but I must be
missing something really obvious.  Here's our
code:

FileOutputStream out = 
    new FileOutputStream("C:\\test.pdf");

Document doc = new Document();
PdfWriter writer = 
    PdfWriter.getInstance(doc, out);            

doc.open();
doc.resetPageCount();
HtmlParser parser = new HtmlParser();   
parser.go(doc, "C:\\TestHtml.html");            
doc.close();

To hanlde the <br> and <img> tags, it looks like
we'll have to modify the HTMLTags and HTMLMap
classes, but it looks like those are the only two
classes that we really need to be concerned
with...

-Jim


-----------------------------------------
Hi,
I need to convert HTML file to PDF. I am not able
to resolve following issues:

1>  When the size of the contents exceeds size of
a pdf page after
conversion, the rest of the contents is trimmed
of. I need to add this
content to next page on pdf.

2> I want to tackle <br> tag to insert a new line
which as of now is
not happening.

3> tackling <img> tag to insert image into pdf at
the place where
image tag exists.

I need to reslve these problems urgently. I would
be extremely
grateful if some one can come out/provide me with
the solution.

Thanks and Regards,
Meghal




                
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. 
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to