问题
I starting figure out in apache.poi
and I couldn't understand what does it mean CTP and PPr in XWPFParagraph
. I have following code:
targetParagraph.getCTP()
.setPPr(index.getParagraph().getCTP().getPPr());
I not found describing of this methods in official documentation apache.poi
Can you explain to me what is it or get me some link where I can read about it?
Thanks for help!
回答1:
getCTP()
returns org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP which from my understanding represends a paragraph on a lower level, strictly related to the xml. It is annotated as @Internal
- it can be changed without much notice.
More of a guess but I'd say that getPPr()
returns an object that represents a paragraph properties.
回答2:
Unfortunately there is not any documentation about the ooxml schemas, the low level basic objects of apache poi
, public available. So we need downloading the sources of ooxml-schemas and then doing javadoc
form those to get a API documentation which describes the classes and methods.
There we then find org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP
, which is a paragraph in a Office Open XML
word processing document and org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPPr
, which are paragraph properties in that kind of document.
Note ooxml-schemas
version 1.4
is for usage together with apache poi 4.0.0
or newer. For older versions ooxml-schemas
version 1.3
is needed.
来源:https://stackoverflow.com/questions/57407697/what-does-it-mean-ctp-and-ppr