Package org.docx4j.events

Examples of org.docx4j.events.PackageIdentifierTransient


    // In this case the events get a name for the events related to this package from the filename
    //WordprocessingMLPackage wordMLPackage = Docx4J.load(new java.io.File(inputfilepath));

    // Approach 2: Load the docx from a file
    // In this case the events get a name for the events related to this package from the filename
    PackageIdentifierTransient pkgIdentifier = new PackageIdentifierTransient("templateXYZ");
    WordprocessingMLPackage wordMLPackage = Docx4J.load(pkgIdentifier, new java.io.File(inputfilepath));
   
    // Approach 3: Load the docx from an input stream
    // In this case, without more, we can't identify which pkg the events belong to
    // so a unique identifier is automatically assigned
View Full Code Here


   *           
   * @Since 2.8.0          
   */ 
  public static OpcPackage load(final java.io.File docxFile, String password) throws Docx4JException {
   
    PackageIdentifier name = new PackageIdentifierTransient(docxFile.getName());
   
    try {
      return OpcPackage.load(name, new FileInputStream(docxFile), password );
    } catch (final FileNotFoundException e) {
      OpcPackage.log.error(e.getMessage(), e);
View Full Code Here

   * @Since 3.1.0     
   */
  private static OpcPackage load(PackageIdentifier pkgIdentifier, final InputStream is, Filetype type, String password) throws Docx4JException {

    if (pkgIdentifier==null) {
      pkgIdentifier = new PackageIdentifierTransient("pkg_" + System.currentTimeMillis());
    }
   
    StartEvent startEvent = new StartEvent( pkgIdentifier,  WellKnownProcessSteps.PKG_LOAD );
    startEvent.publish();     
   
View Full Code Here

TOP

Related Classes of org.docx4j.events.PackageIdentifierTransient

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.