Package org.docx4j.openpackaging.packages

Examples of org.docx4j.openpackaging.packages.OpcPackage


    boolean save = true;
    String outputfilepath = System.getProperty("user.dir") + "/sample-docs/xlsx/pivot-rtt.xlsm";
       
    // Open a document from the file system
    // 1. Load the Package
    OpcPackage pkg = OpcPackage.load(new java.io.File(inputfilepath));
   
    // Save it
   
    if (save) {   
      SaveToZipFile saver = new SaveToZipFile(pkg);
View Full Code Here


   * @param features, the selected features
   * @return a preprocessed OpcPackage
   * @throws Docx4JException
   */
  public static OpcPackage process(OpcPackage opcPackage, Set<String> features) throws Docx4JException {
  OpcPackage  ret = opcPackage;
  Set<String> relationshipTypes = null;
    checkParams(opcPackage, features);
    relationshipTypes = createRelationshipTypes(features);
    if (features.contains(PP_COMMON_DEEP_COPY)) {
      ret = PartialDeepCopy.process(opcPackage, relationshipTypes);
View Full Code Here

   
    String mainPartName = PackageRelsUtil.getNameOfMainPart(rp);
    String pkgContentType = ctm.getContentType(new PartName("/" + mainPartName));

    // 2. Create a new Package; this'll return the appropriate subclass
    OpcPackage p = ctm.createPackage(pkgContentType);
    log.info("Instantiated package of type " + p.getClass().getName() );

    p.setRelationships(rp);
    rp.setSourceP(p); //
   
    // 5. Now recursively
//    (i) create new Parts for each thing listed
//    in the relationships
View Full Code Here

  //private void addPartsFromRelationships(ZipFile zf, Base source, RelationshipsPart rp)
  private void addPartsFromRelationships(HashMap<String, ByteArray> partByteArrays,
      Base source, RelationshipsPart rp, ContentTypeManager ctm)
    throws Docx4JException {
   
    OpcPackage pkg = source.getPackage();       
   
//    for (Iterator it = rp.iterator(); it.hasNext(); ) {
//      Relationship r = (Relationship)it.next();
//      log.info("For Relationship Id=" + r.getId() + " Source is "
//          + r.getSource().getPartName()
View Full Code Here

    boolean save = true;
    String outputfilepath = "data/xlsx4j/pivot-rtt-xlsx4j.xlsm";
       
    // Open a document from the file system
    // 1. Load the Package
    OpcPackage pkg = OpcPackage.load(new java.io.File(inputfilepath));
   
    // Save it
   
    if (save) {   
      SaveToZipFile saver = new SaveToZipFile(pkg);
View Full Code Here

TOP

Related Classes of org.docx4j.openpackaging.packages.OpcPackage

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.