0

I'm converting from html to pdf using iTextSharp. the problem is some css style doesn't work when converted to pdf when I try something like margin-right:500px; or float:left; it doesn't work. however when I try something like color:red; it works. I'm using external css and this is how I'm converting

       MemoryStream cssStream = new MemoryStream(cssByteArray);
   MemoryStream htmlStream = new MemoryStream(htmlByteArray);
XMLWorkerHelper.GetInstance().ParseXHtml(writer,document,htmlStream,cssStream);

/*css*/
/*this one doesn't work */
 .example{
float:right;
}

/*this one doesn't work */
 .secondexample{
margin-right:500px;
}

/*this one works*/
.thirdexample{
  color:red;
}

am I missing something? does iTextSharp has full CSS support ?

Thank You

II Basil II
  • 67
  • 1
  • 10
  • 2
    iText 5 (formerly known as iTextSharp) does not have full CSS support. iText 7 (latest version 7.1.2), with the pdfHTML add-on, supports a lot more CSS. – Amedee Van Gasse May 03 '18 at 05:40
  • 1
    Please read the question [Converting HTML to PDF using iText](https://stackoverflow.com/questions/47895935), and my answer to that question. – Bruno Lowagie May 03 '18 at 11:08

0 Answers0