Package org.docx4j.openpackaging.io

Examples of org.docx4j.openpackaging.io.SaveToZipFile


   
    OpcPackage result = null;
   
    // Zip it up
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    SaveToZipFile saver = new SaveToZipFile(this);
    try {
      saver.save(baos);
      result = load(new ByteArrayInputStream(baos.toByteArray()));
    } catch (Docx4JException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here


      DiagramDrawingPart drawingPart = (DiagramDrawingPart)wordMLPackage.getMainDocumentPart().getRelationshipsPart().getPart(r2);
      drawingPart.setFriendlyIds(thisPart.map);     
      System.out.println( XmlUtils.marshaltoString(drawingPart.getJaxbElement(), true, true));
    }   
   
    SaveToZipFile saver = new SaveToZipFile(wordMLPackage);
    saver.save(System.getProperty("user.dir")
        + "/SmartArt/OUT-clean.docx");
   
 
View Full Code Here

      MainDocumentPart main = wordMLPackage.getMainDocumentPart();
      main.addAltChunk(AltChunkType.WordprocessingML, new FileInputStream(chunkPath) );
    }
   
    if (save) {   
      SaveToZipFile saver = new SaveToZipFile(wordMLPackage);
      saver.save(outputfilepath);
      System.out.println("Saved " + outputfilepath);
    }
  }
View Full Code Here

            "org/docx4j/openpackaging/parts/DrawingML/DiagramLayoutTree4AlgHier.xslt")));
   
    CreateDocxWithSmartArt creatorDocx = new CreateDocxWithSmartArt(diagramLayoutObj, layoutTreeCreatorXslt, layoutTree2DiagramDataXslt);
    WordprocessingMLPackage pkg = creatorDocx.createSmartArtDocx(PageSizePaper.A3, true, MarginsWellKnown.NORMAL, doc);
   
    SaveToZipFile saver = new SaveToZipFile(pkg);
    saver.save(new File(System.getProperty("user.dir")+ "/OUT.docx"  ) );
    System.out.println("Done!");
  }
View Full Code Here

     * EmbeddedPackagePart, add it back onto the deck and save to a file.
     * 
     */   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
   
    SaveToZipFile saver = new SaveToZipFile(spreadSheet);

    saver.save(baos);
    epp.setBinaryData(baos.toByteArray());

    // Write the new file to disk
    ppt.save(new java.io.File(outputfilepath));

View Full Code Here

        drawingPart.setJaxbElement(
            buildDrawingPartContentFromXmlString(imageRelID));
   
   
        // Save the xlsx
    SaveToZipFile saver = new SaveToZipFile(pkg);
    saver.save(outputfilepath);
    System.out.println("\n\n done .. " + outputfilepath)
  }
View Full Code Here

      customProps.getProperty().add(newProp);
    }
   
    // Save the revised document   
    if (save) {   
      SaveToZipFile saver = new SaveToZipFile(wordMLPackage);
      saver.save(outputfilepath);
      System.out.println("Document saved as " + outputfilepath);
    }
   
  }
View Full Code Here

      PresentationMLPackage pmlPackage = (PresentationMLPackage)xmlPackage.get();
     
      // Now that its loaded properly, lets just save it
     
      if (save) {
        SaveToZipFile saver = new SaveToZipFile(pmlPackage);
        saver.save(outputfilepath);
        System.out.println( "\n\n .. written to " + outputfilepath);
      } else {
        // Display its contents
        System.out.println( "\n\n..done " );
      }
View Full Code Here

    long total = end - start;
    System.out.println("Time: " + total);

    // Save it
    if (save) {
      SaveToZipFile saver = new SaveToZipFile(wordMLPackage);
      saver.save(outputfilepath);
    } else {
      System.out.println(XmlUtils.marshaltoString(documentPart.getJaxbElement(), true,
          true));
    }
  }
View Full Code Here

   
    SpreadsheetMLPackage pkg = createPackage();
   
    pkg.createWorksheetPart(new PartName("/xl/worksheets/sheet1.xml"), "Sheet1", 1);
   
    SaveToZipFile saver = new SaveToZipFile(pkg);
    saver.save(outputfilepath);
       
    System.out.println("\n\n done .. " + outputfilepath);
   
 
View Full Code Here

TOP

Related Classes of org.docx4j.openpackaging.io.SaveToZipFile

Copyright © 2018 www.massapicom. 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.