public OpcPackage getPackageFromLocalFile(LocalFile fo) throws Docx4JException {
    OpcPackage thePackage = null;

    String localPath = VFSUtils.getLocalFilePath(fo);
    if (localPath == null) {
      throw new Docx4JException("Couldn't get local path");
    }

    thePackage = _loadFromZipFile.get(new File(localPath));
    return thePackage;
  }
Example #2
0
 // Testing
 public static void main(String[] args) throws Exception {
   String filepath = System.getProperty("user.dir") + "/sample-docs/FontEmbedded.docx";
   log.info("Path: " + filepath);
   LoadFromZipFile loader = new LoadFromZipFile();
   loader.get(filepath);
 }