- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter
类的一些代码示例,展示了XWPFHeaderFooter
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XWPFHeaderFooter
类的具体详情如下:
包路径:org.apache.poi.xwpf.usermodel.XWPFHeaderFooter
类名称:XWPFHeaderFooter
[英]Parent of XWPF headers and footers
[中]XWPF页眉和页脚的父级
代码示例来源:origin: org.apache.poi/poi-ooxml
/**
* save and commit footer
*/
@Override
protected void commit() throws IOException {
XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
xmlOptions.setSaveSyntheticDocumentElement(new QName(CTNumbering.type.getName().getNamespaceURI(), "ftr"));
PackagePart part = getPackagePart();
OutputStream out = part.getOutputStream();
super._getHdrFtr().save(out, xmlOptions);
out.close();
}
代码示例来源:origin: org.apache.poi/poi-ooxml
/**
* Returns the textual content of the header/footer,
* by flattening out the text of its paragraph(s)
*/
public String getText() {
StringBuilder t = new StringBuilder(64);
//TODO: simplify this to get ibody elements in order
for (int i = 0; i < paragraphs.size(); i++) {
if (!paragraphs.get(i).isEmpty()) {
String text = paragraphs.get(i).getText();
if (text != null && text.length() > 0) {
t.append(text);
t.append('\n');
}
}
}
for (int i = 0; i < tables.size(); i++) {
String text = tables.get(i).getText();
if (text != null && text.length() > 0) {
t.append(text);
t.append('\n');
}
}
for (IBodyElement bodyElement : getBodyElements()) {
if (bodyElement instanceof XWPFSDT) {
t.append(((XWPFSDT) bodyElement).getContent().getText() + '\n');
}
}
return t.toString();
}
代码示例来源:origin: org.apache.poi/poi-ooxml
/**
* Adds a picture to the document.
*
* @param is The stream to read image from
* @param format The format of the picture.
* @return the index to this picture (0 based), the added picture can be obtained from {@link #getAllPictures()} .
* @throws InvalidFormatException If the format of the picture is not known.
* @throws IOException If reading the picture-data from the stream fails.
*/
public String addPictureData(InputStream is, int format) throws InvalidFormatException, IOException {
byte[] data = IOUtils.toByteArray(is);
return addPictureData(data, format);
}
代码示例来源:origin: org.apache.poi/poi-ooxml
xwpfPicData = (XWPFPictureData) createRelationship(relDesc, XWPFFactory.getInstance(), idx);
return getRelationId(xwpfPicData);
} else if (!getRelations().contains(xwpfPicData)) {
RelationPart rp = addRelation(null, XWPFRelation.IMAGES, xwpfPicData);
pictures.add(xwpfPicData);
return rp.getRelationship().getId();
} else {
return getRelationId(xwpfPicData);
代码示例来源:origin: org.apache.poi/poi-ooxml
if (isCursorInHdrF(cursor)) {
String uri = CTP.type.getName().getNamespaceURI();
String localPart = "p";
paragraphs.add(0, newP);
} else {
int pos = paragraphs.indexOf(getParagraph((CTP) o)) + 1;
paragraphs.add(pos, newP);
代码示例来源:origin: org.apache.poi/poi-ooxml
relationId = headerFooter.addPictureData(pictureData, pictureType);
picData = (XWPFPictureData) headerFooter.getRelationById(relationId);
} else {
@SuppressWarnings("resource")
代码示例来源:origin: org.apache.poi/poi-ooxml
public XWPFDocument getXWPFDocument() {
if (document != null) {
return document;
} else {
return (XWPFDocument) getParent();
}
}
代码示例来源:origin: org.apache.poi/poi-ooxml
@Override
protected void onDocumentRead() throws IOException {
for (POIXMLDocumentPart poixmlDocumentPart : getRelations()) {
if (poixmlDocumentPart instanceof XWPFPictureData) {
XWPFPictureData xwpfPicData = (XWPFPictureData) poixmlDocumentPart;
pictures.add(xwpfPicData);
document.registerPackagePictureData(xwpfPicData);
}
}
}
代码示例来源:origin: org.apache.poi/poi-ooxml
/**
* returns the PictureData by blipID
*
* @param blipID
* @return XWPFPictureData of a specificID
* @throws Exception
*/
public XWPFPictureData getPictureDataByID(String blipID) {
POIXMLDocumentPart relatedPart = getRelationById(blipID);
if (relatedPart != null && relatedPart instanceof XWPFPictureData) {
return (XWPFPictureData) relatedPart;
}
return null;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
xwpfPicData = (XWPFPictureData) createRelationship(relDesc, XWPFFactory.getInstance(), idx);
return getRelationId(xwpfPicData);
} else if (!getRelations().contains(xwpfPicData)) {
RelationPart rp = addRelation(null, XWPFRelation.IMAGES, xwpfPicData);
pictures.add(xwpfPicData);
return rp.getRelationship().getId();
} else {
return getRelationId(xwpfPicData);
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
if(isCursorInHdrF(cursor)){
String uri = CTP.type.getName().getNamespaceURI();
String localPart = "p";
int pos = paragraphs.indexOf(getParagraph((CTP)o))+1;
paragraphs.add(pos,newP);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
relationId = headerFooter.addPictureData(pictureData, pictureType);
picData = (XWPFPictureData) headerFooter.getRelationById(relationId);
} else {
@SuppressWarnings("resource")
代码示例来源:origin: org.apache.poi/poi-ooxml
/**
* @since by POI 3.14-Beta1
*/
public XWPFHeaderFooter(POIXMLDocumentPart parent, PackagePart part) throws IOException {
super(parent, part);
this.document = (XWPFDocument) getParent();
if (this.document == null) {
throw new NullPointerException();
}
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
@Override
protected void onDocumentRead() throws IOException {
for (POIXMLDocumentPart poixmlDocumentPart : getRelations()){
if(poixmlDocumentPart instanceof XWPFPictureData){
XWPFPictureData xwpfPicData = (XWPFPictureData) poixmlDocumentPart;
pictures.add(xwpfPicData);
document.registerPackagePictureData(xwpfPicData);
}
}
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
/**
* returns the PictureData by blipID
* @param blipID
* @return XWPFPictureData of a specificID
* @throws Exception
*/
public XWPFPictureData getPictureDataByID(String blipID) {
POIXMLDocumentPart relatedPart = getRelationById(blipID);
if (relatedPart != null && relatedPart instanceof XWPFPictureData) {
return (XWPFPictureData) relatedPart;
}
return null;
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
xwpfPicData = (XWPFPictureData) createRelationship(relDesc, XWPFFactory.getInstance(),idx);
return getRelationId(xwpfPicData);
else if (!getRelations().contains(xwpfPicData))
PackagePartName partName = picDataPart.getPartName();
String relation = relDesc.getRelation();
PackageRelationship relShip = getPackagePart().addRelationship(partName,targetMode,relation);
String id = relShip.getId();
addRelation(id,xwpfPicData);
pictures.add(xwpfPicData);
return id;
return getRelationId(xwpfPicData);
代码示例来源:origin: org.apache.poi/poi-ooxml
/**
* save and commit footer
*/
@Override
protected void commit() throws IOException {
XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
xmlOptions.setSaveSyntheticDocumentElement(new QName(CTNumbering.type.getName().getNamespaceURI(), "hdr"));
PackagePart part = getPackagePart();
OutputStream out = part.getOutputStream();
super._getHdrFtr().save(out, xmlOptions);
out.close();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
if (isCursorInHdrF(cursor)) {
String uri = CTP.type.getName().getNamespaceURI();
String localPart = "p";
paragraphs.add(0, newP);
} else {
int pos = paragraphs.indexOf(getParagraph((CTP) o)) + 1;
paragraphs.add(pos, newP);
代码示例来源:origin: apache/tika
private void extractHeaderText(XHTMLContentHandler xhtml, XWPFHeaderFooter header, XWPFListManager listManager) throws SAXException, XmlException, IOException {
for (IBodyElement e : header.getBodyElements()) {
if (e instanceof XWPFParagraph) {
extractParagraph((XWPFParagraph) e, listManager, xhtml);
} else if (e instanceof XWPFTable) {
extractTable((XWPFTable) e, listManager, xhtml);
} else if (e instanceof XWPFSDT) {
extractSDT((XWPFSDT) e, xhtml);
}
}
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
public XWPFDocument getXWPFDocument() {
if (document!=null) {
return document;
} else {
return (XWPFDocument)getParent();
}
}
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter.addRelation()方法的一些代码示例,展示了XWPFHeaderFooter.
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter.getRelations()方法的一些代码示例,展示了XWPFHeaderFooter
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter.getRelationById()方法的一些代码示例,展示了XWPFHeaderFoo
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter.getParagraph()方法的一些代码示例,展示了XWPFHeaderFooter
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter.createRelationship()方法的一些代码示例,展示了XWPFHeader
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter.readHdrFtr()方法的一些代码示例,展示了XWPFHeaderFooter.r
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter.getTable()方法的一些代码示例,展示了XWPFHeaderFooter.get
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter.isCursorInHdrF()方法的一些代码示例,展示了XWPFHeaderFoot
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter.getParent()方法的一些代码示例,展示了XWPFHeaderFooter.ge
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter.createParagraph()方法的一些代码示例,展示了XWPFHeaderFoo
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter.addPictureData()方法的一些代码示例,展示了XWPFHeaderFoot
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter.onDocumentRead()方法的一些代码示例,展示了XWPFHeaderFoot
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter.getBodyElements()方法的一些代码示例,展示了XWPFHeaderFoo
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter.getRelationId()方法的一些代码示例,展示了XWPFHeaderFoote
本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFHeaderFooter._getHdrFtr()方法的一些代码示例,展示了XWPFHeaderFooter._
我是一名优秀的程序员,十分优秀!