Page 1 of 1

Style application and how to resolve it

PostPosted: Fri Jan 28, 2011 2:52 am
by talk.do.stop
I want to get the effective character formatting for a piece of text (within a <w:r> element). I can use org.docx4j.model.PropertyResolver to resolve its style, even if it's inherited. However, I can't find how to apply formatting from different sources, i.e. the final formatting of a run is the result of applying its manual formatting, its character style, its enclosing paragraph's style, and its enclosing table's style (if it exists), with some extra quirks around toggle properties. See p. 32 of http://www.doxtop.com/browse/925bbc5e/04---wordprocessingml-advanced.aspx for the details. Is it implemented in docx4j?

Re: Style application and how to resolve it

PostPosted: Fri Jan 28, 2011 12:47 pm
by jason
In org.docx4j.model.PropertyResolver see:

Code: Select all
public RPr getEffectiveRPr(RPr expressRPr, PPr pPr)


The implementation is partial - its primary use is for XSL FO (PDF) output; for HTML, we take advantage of CSS's cascade.

Curious to understand why you need this?

Re: Style application and how to resolve it

PostPosted: Sat Jan 29, 2011 12:24 am
by talk.do.stop
Thanks for the pointer. I'm producing output to a legacy format that doesn't support CSS, but text formatting is required.