Applying css while converting html to pdf using iText
You can't directly load the external css file, but you can define the styles as specifed in stylesheets using "StyleSheet" class in iText library. Please refer below URL for example.
http://itextpdf.com/examples/iia.php?id=56
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on June 04, 2022Comments
-
Admin about 2 years
am trying to convert html to pdf on the fly. I am using iText to achieve this. I succeeded in doing the conversion as such, but am stuck at a situation where I have to apply a external CSS file to convert this HTML to PDF. I searched through the iText mailing list, google for quite sometime now. All I understood is it is not possible to apply external css files.
Can anyone please correct me if I am wrong? Or is there a way to apply external css to convert html to pdf on the fly? Any hints on how to proceed will be much appreciated.