Thanks for the answer. I do not have any kind of setup. The code I included in the first post is all I use to apply the CSS.
Do you mean something else for "setup"? Regards EdGioja wrote > Do you have a setup I can look at? > > > > > > "Do the best you can until you know Edward Gioja > better. Then when you know better, do Programmer/Analyst > better." -Maya Angelou (312)582-5232 > (509)465-8453 > (Embedded image moved to > file: pic06334.gif) > > > > > > > > > > > > > > > > > > > > From: roboboot < > rbattistoni@ > > > To: > itext-questions@.sourceforge > Date: 08/15/2013 11:00 AM > Subject: Re: [iText-questions] XMLWorker: CSS does not work only if it > is selected the "class" attribute of a TAG > > > > Sorry guys, > > Is there anyone with is problem? > > Thanks again > > > > roboboot wrote >> 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-tp4658789p4658928.html > > Sent from the iText - General mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > > Get 100% visibility into Java/.NET code with AppDynamics Lite! > It's a free troubleshooting tool designed for production. > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk > _______________________________________________ > iText-questions mailing list > iText-questions@.sourceforge > 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 > > ------------------------------------------------------------------------------ > Get 100% visibility into Java/.NET code with AppDynamics Lite! > It's a free troubleshooting tool designed for production. > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk > _______________________________________________ > iText-questions mailing list > iText-questions@.sourceforge > 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 > > pic06334.gif (1K) > <http://itext-general.2136553.n4.nabble.com/attachment/4658935/0/pic06334.gif> -- 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-tp4658789p4658937.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&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