Package org.docx4j.convert.in

Examples of org.docx4j.convert.in.FlatOpcXmlImporter


        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


        FlatOpcXmlCreator foxc = new FlatOpcXmlCreator(docxTemplate);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try {
            foxc.marshal(baos);
            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
            FlatOpcXmlImporter foxi = new FlatOpcXmlImporter(bais);
            docxTemplate = (WordprocessingMLPackage) foxi.get();
        } catch (Docx4JException e) {
            throw new MergeException("unable to defensive copy (problem exporting)", e);
        } catch (@SuppressWarnings("restriction") JAXBException e) {
            throw new MergeException("unable to defensive copy (problem importing)", e);
        }
View Full Code Here

        FlatOpcXmlCreator foxc = new FlatOpcXmlCreator(docxTemplate);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try {
            foxc.marshal(baos);
            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
            FlatOpcXmlImporter foxi = new FlatOpcXmlImporter(bais);
            docxTemplate = (WordprocessingMLPackage) foxi.get();
        } catch (Docx4JException e) {
            throw new MergeException("unable to defensive copy (problem exporting)", e);
        } catch (@SuppressWarnings("restriction") JAXBException e) {
            throw new MergeException("unable to defensive copy (problem importing)", e);
        }
View Full Code Here

TOP

Related Classes of org.docx4j.convert.in.FlatOpcXmlImporter

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.