/** * Save a Docx Document to a File. * * @since 3.3.0 */ public static void save(WordprocessingMLPackage wmlPackage, File outFile) throws Docx4JException { wmlPackage.save(outFile, Docx4J.FLAG_SAVE_ZIP_FILE); }
/** * Load a docx/pptx/xlsx from a File, where you know in advance what type (zip, compound, flat opc) * it is. Typically you'll cast the result to WordprocessingMLPackage or pptx/xlsx equivalent. * @since 6.0.0 */ public static OpcPackage load(final File inFile, Filetype type) throws Docx4JException { return OpcPackage.load(inFile); }
/** * Save this pkg to a File. The flag is typically Docx4J.FLAG_SAVE_ZIP_FILE * or Docx4J.FLAG_SAVE_FLAT_XML * * @since 3.1.0 */ public void save(File outFile, int flags) throws Docx4JException { save( outFile, flags, null); }
/** * Load a Docx Document from a File */ public static WordprocessingMLPackage load(File inFile) throws Docx4JException { return WordprocessingMLPackage.load(inFile); }
/** * Enforces the protection passed in sheetProtection, with the specified password, * using sha512 (like Excel 2013). * * @param sheetProtection * @param password * @throws Xlsx4jException * @since 3.3.0 */ public void setSheetProtectionPassword(CTSheetProtection sheetProtection, String password) throws Xlsx4jException { setSheetProtection( sheetProtection, password, HashAlgorithm.sha512); }
/** * Save a Docx Document to a File. The flag is typically Docx4J.FLAG_SAVE_ZIP_FILE * or Docx4J.FLAG_SAVE_FLAT_XML or one of the Docx4J.FLAG_SAVE_ENCRYPTED_ variants * (recommend FLAG_SAVE_ENCRYPTED_AGILE) * * For the FLAG_SAVE_ENCRYPTED_ variants, you need to provide a password. */ public static void save(WordprocessingMLPackage wmlPackage, File outFile, int flags, String password) throws Docx4JException { wmlPackage.save(outFile, flags, password); }
/** * Load a Docx Document from an InputStream */ public static WordprocessingMLPackage load(InputStream inStream) throws Docx4JException { return WordprocessingMLPackage.load(inStream); }
/** * Load a Docx Document from a File, assigning it an identifier for eventing * * @since 3.1.0 */ public static WordprocessingMLPackage load(PackageIdentifier pkgIdentifier, File inFile) throws Docx4JException { return (WordprocessingMLPackage)OpcPackage.load(pkgIdentifier, inFile); }
/** * Save this pkg to an OutputStream. The flag is typically Docx4J.FLAG_SAVE_ZIP_FILE * or Docx4J.FLAG_SAVE_FLAT_XML * * @since 3.1.0 */ public void save(OutputStream outStream, int flags) throws Docx4JException { save( outStream, flags, null); }
/** * Save this pkg to an OutputStream. The flag is typically Docx4J.FLAG_SAVE_ZIP_FILE * or Docx4J.FLAG_SAVE_FLAT_XML or one of the Docx4J.FLAG_SAVE_ENCRYPTED_ variants * (recommend FLAG_SAVE_ENCRYPTED_AGILE) * * For the FLAG_SAVE_ENCRYPTED_ variants, you need to provide a password. */ public static void save(WordprocessingMLPackage wmlPackage, OutputStream outStream, int flags, String password) throws Docx4JException { wmlPackage.save(outStream, flags, password); }
/** * Creates a <code>PresentationMLPackage</code> from an <code>InputStream</code>. * @param pptxInputStream an <code>InputStream</code> of a .pptx file * @return a <code>PresentationMLPackage</code> representing the .pptx file * @throws Docx4JException if an exception is encountered in processing */ public static PresentationMLPackage load(InputStream pptxInputStream) throws Docx4JException { return (PresentationMLPackage)OpcPackage.load(pptxInputStream); }
/** * Save this pkg to an OutputStream in the usual zipped up format * (Docx4J.FLAG_SAVE_ZIP_FILE) * * @since 3.1.0 */ public void save(OutputStream outStream) throws Docx4JException { save(outStream, Docx4J.FLAG_SAVE_ZIP_FILE); }
/** * Save a Docx Document to an OutputStream. The flag is typically Docx4J.FLAG_SAVE_ZIP_FILE or Docx4J.FLAG_SAVE_FLAT_XML */ public static void save(WordprocessingMLPackage wmlPackage, OutputStream outStream, int flags) throws Docx4JException { wmlPackage.save(outStream, flags); }
/** * Convenience method to create a WordprocessingMLPackage * or PresentationMLPackage * from an existing File (.docx/.docxm, .ppxtx or Flat OPC .xml). * * @param docxFile * The docx file */ public static OpcPackage load(final java.io.File docxFile) throws Docx4JException { return load(docxFile, ""); }
/** * Save a Docx Document to a File. The flag is typically Docx4J.FLAG_SAVE_ZIP_FILE or Docx4J.FLAG_SAVE_FLAT_XML */ public static void save(WordprocessingMLPackage wmlPackage, File outFile, int flags) throws Docx4JException { wmlPackage.save(outFile, flags); }
/** * Convenience method to create a WordprocessingMLPackage * from an existing File (.docx zip or .xml Flat OPC). * * @param docxFile * The docx file */ public static WordprocessingMLPackage load(java.io.File docxFile) throws Docx4JException { return (WordprocessingMLPackage)OpcPackage.load(docxFile); }
/** * Save a Docx Document to an OutputStream using flag Docx4J.FLAG_SAVE_ZIP_FILE * * @since 3.3.0 */ public static void save(WordprocessingMLPackage wmlPackage, OutputStream outStream) throws Docx4JException { wmlPackage.save(outStream, Docx4J.FLAG_SAVE_ZIP_FILE); }
/** * Convenience method to create a WordprocessingMLPackage * or PresentationMLPackage * from an existing File (.docx/.docxm, .ppxtx or Flat OPC .xml). * * @param docxFile * The docx file * @since 3.1.0 */ public static OpcPackage load(PackageIdentifier pkgIdentifier, final java.io.File docxFile) throws Docx4JException { return load(pkgIdentifier, docxFile, null); }
/** * Convenience method to create a SpreadsheetMLPackage * from an existing File (.xlsx or .xml Flat OPC). * * @param xlsxFile * The xlsx file */ public static SpreadsheetMLPackage load(java.io.File xlsxFile) throws Docx4JException { return (SpreadsheetMLPackage)OpcPackage.load(xlsxFile); }
/** * Load a Docx Document from an InputStream, assigning it an identifier for eventing * * @since 3.1.0 */ public static WordprocessingMLPackage load(PackageIdentifier pkgIdentifier, InputStream inStream) throws Docx4JException { return (WordprocessingMLPackage)OpcPackage.load(pkgIdentifier, inStream); }