Code4Fun
Code4Fun

Reputation: 125

itextpdf xmlworker add-on does not align the text justified in PDF

I am using itext-pdf 5.4 to create PDF documents. In this process, I plan to create some HTML and then parse with xmlworker add-on. However, irrespective of the fact that, I am specifying

<div align="justify">..</div>

OR

<p align="justify">

I am not able to see the desired effects. The text in PDF looks very bad, as does not span the entire line. Can some one help me here by explaining the correct approach to go about this.

Upvotes: 2

Views: 1659

Answers (1)

Zach Johnson
Zach Johnson

Reputation: 123

The align attribute is deprecated, so I don't think you can use that. Rather than an align attribute on an element you should do it through css, but I don't think that's supported with iText XMLWorker - have a look at this: http://demo.itextsupport.com/xmlworker/itextdoc/CSS-conformance-list.htm

I'd been trying to display:inline-block and finally came across that and learned it's not supported... :(

Upvotes: 2

Related Questions