Hi all, 

I use a very simple CSS in XMLWorker to render HTML to PDFs. Here is the
CSS:

***********
body { font-family: "Times New Roman;" }

p.testoJustify {
text-align:justify; 
text-justify:inter-word;
}
***********

The problem is on the ".testoJustify" selector. When I use this selector,
the resulting PDF doesn't have the text justified, while without the
selector, so only with p {... }, it works fine! 

The java code is the following:

***********
FontFactory.registerDirectories();

XMLWorkerFontProvider fontProvider = new XMLWorkerFontProvider();
CssAppliers cssAppliers = new CssAppliersImpl(fontProvider);
HtmlPipelineContext htmlContext = new HtmlPipelineContext(cssAppliers);
htmlContext.setTagFactory(Tags.getHtmlTagProcessorFactory());
                         
CSSResolver cssResolver
=XMLWorkerHelper.getInstance().getDefaultCssResolver(true);
cssResolver.addCss(Context.pdfCss, true);
Context.getInstance().getLogger().debug("CSS: "+Context.pdfCss);
Pipeline<?> pipeline = new CssResolverPipeline(cssResolver,
                                                                new 
HtmlPipeline(htmlContext,
                                                                        new 
PdfWriterPipeline(pdfDocument, pdfWriter)));
***********

This is the link to JSFiddle showing that CSS is corrected applied on HTML
page, but not XMLWorker:

http://jsfiddle.net/6vrMP/

Any idea?

Thanks



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/XMLWorker-CSS-does-not-work-only-if-it-is-selected-the-class-attribute-of-a-TAG-tp4658789.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to