org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy.assignHeader()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy.assignHeader()方法的一些代码示例,展示了XWPFHeaderFooterPolicy.assignHeader()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XWPFHeaderFooterPolicy.assignHeader()方法的具体详情如下:
包路径:org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy
类名称:XWPFHeaderFooterPolicy
方法名:assignHeader

XWPFHeaderFooterPolicy.assignHeader介绍

暂无

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Creates a new header of the specified type, to which the
 * supplied (and previously unattached!) paragraphs are
 * added to.
 */
public XWPFHeader createHeader(Enum type, XWPFParagraph[] pars) {
  XWPFHeader header = getHeader(type);
  if (header == null) {
    HdrDocument hdrDoc = HdrDocument.Factory.newInstance();
    XWPFRelation relation = XWPFRelation.HEADER;
    int i = getRelationIndex(relation);
    XWPFHeader wrapper = (XWPFHeader) doc.createRelationship(relation,
        XWPFFactory.getInstance(), i);
    wrapper.setXWPFDocument(doc);
    CTHdrFtr hdr = buildHdr(type, wrapper, pars);
    wrapper.setHeaderFooter(hdr);
    hdrDoc.setHdr(hdr);
    assignHeader(wrapper, type);
    header = wrapper;
  }
  return header;
}

代码示例来源:origin: org.apache.poi/poi-ooxml

assignHeader(hdr, type);

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

public XWPFHeader createHeader(Enum type, XWPFParagraph[] pars) throws IOException {
  XWPFRelation relation = XWPFRelation.HEADER;
  String pStyle = "Header";
  int i = getRelationIndex(relation);
  HdrDocument hdrDoc = HdrDocument.Factory.newInstance();
  XWPFHeader wrapper = (XWPFHeader)doc.createRelationship(relation, XWPFFactory.getInstance(), i);
  CTHdrFtr hdr = buildHdr(type, pStyle, wrapper, pars);
  wrapper.setHeaderFooter(hdr);
  OutputStream outputStream = wrapper.getPackagePart().getOutputStream();
  hdrDoc.setHdr(hdr);
  XmlOptions xmlOptions = commit(wrapper);
  assignHeader(wrapper, type);
  hdrDoc.save(outputStream, xmlOptions);
  outputStream.close();
  return wrapper;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Creates a new header of the specified type, to which the
 * supplied (and previously unattached!) paragraphs are
 * added to.
 */
public XWPFHeader createHeader(Enum type, XWPFParagraph[] pars) {
  XWPFHeader header = getHeader(type);
  if (header == null) {
    HdrDocument hdrDoc = HdrDocument.Factory.newInstance();
    XWPFRelation relation = XWPFRelation.HEADER;
    int i = getRelationIndex(relation);
    XWPFHeader wrapper = (XWPFHeader) doc.createRelationship(relation,
        XWPFFactory.getInstance(), i);
    wrapper.setXWPFDocument(doc);
    CTHdrFtr hdr = buildHdr(type, wrapper, pars);
    wrapper.setHeaderFooter(hdr);
    hdrDoc.setHdr(hdr);
    assignHeader(wrapper, type);
    header = wrapper;
  }
  return header;
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

assignHeader(hdr, type);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

assignHeader(hdr, type);

相关文章