Examples of HdrDocument


Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.HdrDocument

    this.doc = doc;
    for(int i=0; i<sectPr.sizeOfHeaderReferenceArray(); i++) {
      // Get the header
      CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i);
      PackagePart hdrPart = doc.getPartById(ref.getId());
      HdrDocument hdrDoc = HdrDocument.Factory.parse(hdrPart.getInputStream());
      CTHdrFtr hdrFtr = hdrDoc.getHdr();
      XWPFHeader hdr = new XWPFHeader(doc, hdrFtr);

      // Assign it
      Enum type = ref.getType();
      assignHeader(hdr, type);
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.HdrDocument

   
    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;
    }
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.HdrDocument

    @Override 
      protected void onDocumentRead(){
        bodyElements = new ArrayList<IBodyElement>();
          paragraphs = new ArrayList<XWPFParagraph>();
          tables= new ArrayList<XWPFTable>();
          HdrDocument hdrDocument = null;
      InputStream is;
      try {
        is = getPackagePart().getInputStream();
        hdrDocument = HdrDocument.Factory.parse(is);
        headerFooter = hdrDocument.getHdr();
            // parse the document with cursor and add
            // the XmlObject to its lists
        XmlCursor cursor = headerFooter.newCursor();
            cursor.selectPath("./*");
            while (cursor.toNextSelection()) {
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.HdrDocument

    this.doc = doc;
    for(int i=0; i<sectPr.sizeOfHeaderReferenceArray(); i++) {
      // Get the header
      CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i);
      PackagePart hdrPart = doc.getPartById(ref.getId());
      HdrDocument hdrDoc = HdrDocument.Factory.parse(hdrPart.getInputStream());
      CTHdrFtr hdrFtr = hdrDoc.getHdr();
      XWPFHeader hdr = new XWPFHeader(hdrFtr);

      // Assign it
      Enum type = ref.getType();
      assignHeader(hdr, type);
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.HdrDocument

   
    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);
     
      OutputStream outputStream = wrapper.getPackagePart().getOutputStream();
      hdrDoc.setHdr(hdr);
     
        XmlOptions xmlOptions = commit(wrapper);

      assignHeader(wrapper, type);
    hdrDoc.save(outputStream, xmlOptions);
    outputStream.close();
      return wrapper;
    }
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.HdrDocument

     */
    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;
    }
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.HdrDocument

     * @throws IOException
     */
    @Override 
    protected void onDocumentRead() throws IOException {
        super.onDocumentRead();           
        HdrDocument hdrDocument = null;
        InputStream is;
        try {
            is = getPackagePart().getInputStream();
            hdrDocument = HdrDocument.Factory.parse(is);
            headerFooter = hdrDocument.getHdr();
            // parse the document with cursor and add
            // the XmlObject to its lists
            XmlCursor cursor = headerFooter.newCursor();
            cursor.selectPath("./*");
            while (cursor.toNextSelection()) {
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.HdrDocument

    this.doc = doc;
    for(int i=0; i<sectPr.sizeOfHeaderReferenceArray(); i++) {
      // Get the header
      CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i);
      PackagePart hdrPart = doc.getPartById(ref.getId());
      HdrDocument hdrDoc = HdrDocument.Factory.parse(hdrPart.getInputStream());
      CTHdrFtr hdrFtr = hdrDoc.getHdr();
      XWPFHeader hdr = new XWPFHeader(hdrFtr);

      // Assign it
      Enum type = ref.getType();
      assignHeader(hdr, type);
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.HdrDocument

   
    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);
     
      OutputStream outputStream = wrapper.getPackagePart().getOutputStream();
      hdrDoc.setHdr(hdr);
     
        XmlOptions xmlOptions = commit(wrapper);

      assignHeader(wrapper, type);
    hdrDoc.save(outputStream, xmlOptions);
    outputStream.close();
      return wrapper;
    }
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.HdrDocument

    this.doc = doc;
    for(int i=0; i<sectPr.sizeOfHeaderReferenceArray(); i++) {
      // Get the header
      CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i);
      PackagePart hdrPart = doc.getPartById(ref.getId());
      HdrDocument hdrDoc = HdrDocument.Factory.parse(hdrPart.getInputStream());
      CTHdrFtr hdrFtr = hdrDoc.getHdr();
      XWPFHeader hdr = new XWPFHeader(hdrFtr);

      // Assign it
      Enum type = ref.getType();
      assignHeader(hdr, type);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.