Package org.docx4j.events

Examples of org.docx4j.events.EventFinished


      placeholderLookup = new FopPlaceholderLookup(pageNumberInformation);
      formattingResults = calcResults(fopFactory, apacheFopMime, foDocumentSrc, placeholderLookup);
      placeholderLookup.setResults(formattingResults);
      foDocumentSrc = new StreamSource(new StringReader(foDocument));
     
      new EventFinished(startEvent).publish();
     
    }
   
    //1st pass in 1 pass or 2nd pass in 2 pass
   
    if (TEXTBOX_POSTPROCESSING_REQUIRED) {
     
//      System.out.println("\n\n performing TEXTBOX_POSTPROCESSING \n\n");
     
      DOMResult result = new DOMResult();
      org.docx4j.XmlUtils.transform(foDocumentSrc, xslt_POSTPROCESSING, null, result);   

      org.w3c.dom.Document docResult = ((org.w3c.dom.Document)result.getNode());
      String modifiedFO = XmlUtils.w3CDomNodeToString(docResult);
      log.debug("After moving! \n" + modifiedFO)
     
      foDocumentSrc = new StreamSource(new StringReader(modifiedFO));
     
    }

    StartEvent startEvent = new StartEvent( settings.getWmlPackage(), WellKnownProcessSteps.FOP_RENDER_PASS1 );
    startEvent.publish();
   
    render(fopFactory, apacheFopMime, foDocumentSrc, placeholderLookup, outputStream);
   
    new EventFinished(startEvent).publish();
  }
View Full Code Here


      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    log.debug("resulting LMS: " + XmlUtils.marshaltoString(lms, Context.getXslFoContext()));
   
    new EventFinished(startEvent).publish();
   
  }
View Full Code Here

          throw new Docx4JException("Problems creating a org.w3c.dom.Document for the passed input stream.", e);
        }
    }
        bind(wmlPackage, xmlDoc, flags);
       
    new EventFinished(bindJobStartEvent).publish();
       
  }
View Full Code Here

      StartEvent startEvent = new StartEvent( WellKnownJobTypes.BIND, wmlPackage, WellKnownProcessSteps.BIND_INSERT_XML );
      startEvent.publish();
     
      insertXMLData(customXmlDataStoragePart, xmlDocument);
     
      new EventFinished(startEvent).publish();
    }
    if ((flags & FLAG_BIND_BIND_XML) == FLAG_BIND_BIND_XML) {
     
      StartEvent startEvent = new StartEvent( WellKnownJobTypes.BIND, wmlPackage, WellKnownProcessSteps.BIND_BIND_XML );
      startEvent.publish();
     
      if (wmlPackage.getMainDocumentPart().getXPathsPart()!=null) {
        openDoPEHandler = new OpenDoPEHandler(wmlPackage);
        openDoPEHandler.preprocess();
       
        bookmarkId = openDoPEHandler.getNextBookmarkId();
      }
      BindingHandler bh = new BindingHandler(wmlPackage);
      bh.setStartingIdForNewBookmarks(bookmarkId);
      bh.applyBindings();
     
      new EventFinished(startEvent).publish();
    }
    if ((flags & FLAG_BIND_REMOVE_SDT) == FLAG_BIND_REMOVE_SDT) {
     
      StartEvent startEvent = new StartEvent( WellKnownJobTypes.BIND, wmlPackage, WellKnownProcessSteps.BIND_REMOVE_SDT );
      startEvent.publish();

      removeSDTs(wmlPackage);
     
      new EventFinished(startEvent).publish();
    }
    if ((flags & FLAG_BIND_REMOVE_XML) == FLAG_BIND_REMOVE_XML) {
     
      StartEvent startEvent = new StartEvent( WellKnownJobTypes.BIND, wmlPackage, WellKnownProcessSteps.BIND_REMOVE_XML );
      startEvent.publish();
     
      removeDefinedCustomXmlParts(wmlPackage, customXmlDataStoragePart);
     
      new EventFinished(startEvent).publish();
    }
  }
View Full Code Here

    FOSettings settings = createFOSettings();
    settings.setWmlPackage(wmlPackage);
    settings.setApacheFopMime("application/pdf");
    toFO(settings, outputStream, FLAG_NONE);
   
    new EventFinished(startEvent).publish();
  }
View Full Code Here

    startEvent.publish();
   
    Exporter<HTMLSettings> exporter = getHTMLExporter(flags);
    exporter.export(settings, outputStream);
   
    new EventFinished(startEvent).publish();
  }
View Full Code Here

    if (imageTargetUri != null) {
      settings.setImageTargetUri(imageTargetUri);
    }
    toHTML(settings, outputStream, FLAG_NONE);
   
    new EventFinished(startEvent).publish();
  }
View Full Code Here

     
      if (pkgIdentifier!=null) {
        opcPackage.setName(pkgIdentifier.name());
      }
     
      new EventFinished(startEvent).publish();           
      return opcPackage;
     
//      final LoadFromZipNG loader = new LoadFromZipNG();
//      return loader.get(is);     
     
    } else if (type.equals(Filetype.Compound)){
     
          try {
        POIFSFileSystem fs = new POIFSFileSystem(is);
        EncryptionInfo info = new EncryptionInfo(fs);
            Decryptor d = Decryptor.getInstance(info);
            d.verifyPassword(password);
           
        InputStream is2 = d.getDataStream(fs);
        final LoadFromZipNG loader = new LoadFromZipNG();
        return loader.get(is2);       
       
      } catch (java.security.InvalidKeyException e) {
            /* Wrong password results in:
             *
              Caused by: java.security.InvalidKeyException: No installed provider supports this key: (null)
            at javax.crypto.Cipher.a(DashoA13*..)
            at javax.crypto.Cipher.init(DashoA13*..)
            at javax.crypto.Cipher.init(DashoA13*..)
            at org.apache.poi.poifs.crypt.AgileDecryptor.getCipher(AgileDecryptor.java:216)
            at org.apache.poi.poifs.crypt.AgileDecryptor.access$200(AgileDecryptor.java:39)
            at org.apache.poi.poifs.crypt.AgileDecryptor$ChunkedCipherInputStream.<init>(AgileDecryptor.java:127)
            at org.apache.poi.poifs.crypt.AgileDecryptor.getDataStream(AgileDecryptor.java:103)
            at org.apache.poi.poifs.crypt.Decryptor.getDataStream(Decryptor.java:85)           
             */
        throw new Docx4JException("Problem reading compound file: wrong password?", e);
      } catch (Exception e) {
        throw new Docx4JException("Problem reading compound file", e);
      } finally {
        new EventFinished(startEvent).publish();       
      }
    }
   
    try {
      FlatOpcXmlImporter xmlPackage = new FlatOpcXmlImporter(is);
      return xmlPackage.get();
    } catch (final Exception e) {
      OpcPackage.log.error(e.getMessage(), e);
      throw new Docx4JException("Couldn't load xml from stream ",e);
    } finally {
      new EventFinished(startEvent).publish();                 
    }
  }
View Full Code Here

    else {
//      SaveToZipFile saver = new SaveToZipFile(wmlPackage);
      Save saver = new Save(this);
      saver.save(outStream);
    }
    new EventFinished(startEvent).publish();
 
View Full Code Here

    Document domDoc = getSourceDocument(conversionSettings, conversionContext);
    Templates templates = getTemplates(conversionSettings, conversionContext);
    Result intermediateResult = new StreamResult(outputStream);
    XmlUtils.transform(domDoc, templates, conversionContext.getXsltParameters(), intermediateResult);
   
    new EventFinished(startEvent).publish();
   
  }
View Full Code Here

TOP

Related Classes of org.docx4j.events.EventFinished

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.