Hi all,

With the following code, I am able to convert the html to pdf.  But the thing 
is that the alignment of the content of resulting pdf is different from the 
html file.

Document document = new Document(new Rectangle(612f, 792f));
TextReader tr = new StreamReader(@"C:\Test\ActualHTML.htm");
PdfWriter writer = PdfWriter.GetInstance(document, new 
FileStream(@"c:\test\ResultingPDF.pdf", FileMode.Create));

document.Open();

System.Xml.XmlTextReader reader = new System.Xml.XmlTextReader(tr);
reader.WhitespaceHandling = System.Xml.WhitespaceHandling.All;
iTextSharp.text.html.HtmlParser.Parse(document, reader);

document.Close();

tr.Close();
tr.Dispose();

Please help me in fixing this issue.

Thanks in advance
Gafoor


________________________________
"This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error, please notify the Compliance Division of 
Apollo Health Street Ltd [EMAIL PROTECTED]"
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to