GroupDocs.Conversion for Java 20.10 Release Notes
Major Features
There are 20+ features, improvements and bug-fixes in this release, most notable are:
- Conversions from PST, OST - can convert each message, contact to different format
- Now is possible to convert each email attachment to different format
- Conversions from Oxps, Fods, Otg
- Conversion to Fods
- Improved caching
- Introduced in-memory caching
- Conversions from/to Md (markdown)
- Conversions from/to Fodp
- XML can be used as data source for conversion
- Improved pst/ost documents info
Full List of Issues Covering all Changes in this Release
Key | Summary | Category |
---|---|---|
CONVERSIONNET‑3225 | Feature | Support for auto page numbering while export to PDF |
CONVERSIONNET‑3710 | Feature | Convert each email attachment to different type |
CONVERSIONNET‑3778 | Feature | Convert from PST, OST |
CONVERSIONNET‑3812 | Feature | Implement conversion from Oxps |
CONVERSIONNET‑3816 | Feature | Implement conversion from Fods |
CONVERSIONNET‑3822 | Feature | Implement conversion to Fods |
CONVERSIONNET‑3823 | Feature | Implement conversion from Otg |
CONVERSIONNET‑2875 | Feature | Introduced in memory caching |
CONVERSIONNET‑3659 | Improvement | Improve font substitution when converting from PDF |
CONVERSIONNET‑3874 | Improvement | Improved caching |
CONVERSIONNET‑3888 | Improvement | Improved document info for pst/ost documents |
CONVERSIONNET‑1702 | Fix | A generic error occurred in GDI+ while saving document to LZW TIFF |
CONVERSIONNET‑3699 | Fix | Exception while Converting PST to CSV using GroupDocs.Conversion .NET API v20.1.0 As The Not supported file type |
CONVERSIONNET‑3724 | Fix | Exception while Converting XLSB to XLS using GroupDocs.Conversion .NET API v20.1.0 |
CONVERSIONNET‑3729 | Fix | Exception while Converting XLSB to XLSX As The column index should not be inside the pivot table report |
CONVERSIONNET‑3745 | Fix | XLSB to XLS conversion issue |
CONVERSIONNET‑3768 | Fix | “System.DllNotFoundException : Unable to load DLL ’libgdiplus’: The specified module could not be found.” exception on MacOS targeting .NET Standard |
CONVERSIONNET‑3770 | Fix | VSD to DOC conversion issue |
CONVERSIONNET‑3790 | Fix | Xps and Tex files are converted in trial mode when using venture licensing |
CONVERSIONNET‑3804 | Fix | PCL to DOT file conversion |
CONVERSIONNET‑3810 | Fix | XLSX to XLS conversion - The column index should not be inside the pivottable report |
CONVERSIONNET‑3821 | Fix | GroupDocs.Conversion.Exceptions.GroupDocsConversionException was unhandled |
CONVERSIONNET‑3680 | Fix | Exception while Converting TXT to CSV using GroupDocs.Conversion .NET API v20.1.0 |
CONVERSIONNET‑3694 | Fix | Exception while Converting PDF to XLSM using GroupDocs.Conversion .NET API v20.1.0 |
CONVERSIONNET‑3730 | Fix | Exception while Converting VSDX to XLSX using GroupDocs.Conversion .NET API v20.1 |
CONVERSIONNET‑3785 | Fix | Cc filed missing in EmailField |
CONVERSIONNET‑3795 | Fix | PDF to XLSM Conversion issue |
CONVERSIONNET‑3818 | Fix | DOC to XLS conversion issue for a particular file |
CONVERSIONNET‑3820 | Fix | Can’t convert docx to xls |
CONVERSIONNET‑3833 | Fix | VTX to JPG conversion issue |
CONVERSIONNET‑3850 | Fix | Xlsx to xlsm conversion issue |
CONVERSIONNET‑3852 | Fix | Docx to csv conversion issue - cannot conver the file is corrupt or damaged |
CONVERSIONNET‑3876 | Fix | Exception if provided folder not exist in ost/pst documents |
CONVERSIONNET‑3878 | Fix | VTX to PNG conversion issue |
CONVERSIONNET‑3879 | Fix | Cannot convert a particular eml file to xls |
CONVERSIONNET‑3884 | Fix | Implement conversion from CFF2 |
CONVERSIONNET‑3885 | Fix | PDF to TSV conversion issue |
CONVERSIONNET‑3890 | Fix | DOCX/DOC to XLS conversion issue |
CONVERSIONNET‑3894 | Fix | TXT to CSV/XLSX conversion issue |
CONVERSIONNET‑3926 | Fix | HTML to XLS conversion issue |
CONVERSIONNET‑3928 | Fix | Doc to Xlsx conversion issue |
CONVERSIONNET‑3938 | Fix | Wrong Height and Width are returning from GetDocumentInfo method |
CONVERSIONJAVA‑704 | Fix | CrossTableNotFoundException when converting a particular PDF to Image |
CONVERSIONJAVA‑771 | Fix | The support for page numeration in the output document |
CONVERSIONJAVA‑818 | Fix | Issue in converting a Word file to PDF with Arabic font |
CONVERSIONJAVA‑844 | Fix | Error in converting a particular DOCX to PDF |
CONVERSIONJAVA‑933 | Fix | Absolute URI is too short |
CONVERSIONJAVA‑993 | Fix | DWG to JPG ImageSaveException (java heap space) |
CONVERSIONJAVA‑1084 | Fix | Heap - OutOfMemory issues |
Public API and Backward Incompatible Changes
- Converter class has new constructor overloads
/**
* Initializes new instance of Converter class.
* @param document A readable stream.
* @param loadOptions The methods that returns document load options.
*/
public Converter(InputStream document, Func1<FileType, LoadOptions> loadOptions)
/**
* Initializes new instance of Converter class.
* @param document The method that returns readable stream.
* @param loadOptions The methods that returns document load options.
* @param settings The Converter settings.
*/
public Converter(InputStream document, Func1<FileType, LoadOptions> loadOptions, ConverterSettings settings)
/**
* Initializes new instance of Converter class.
* @param filePath The file path to the source document.
* @param loadOptions The document load options.
*/
public Converter(String filePath, Func1<FileType, LoadOptions> loadOptions)
/**
* Initializes new instance of Converter class.
* @param filePath The file path to the source document.
* @param loadOptions The document load options.
* @param settings The Converter settings.
*/
public Converter(String filePath, Func1<FileType, LoadOptions> loadOptions, ConverterSettings settings)
Usage
Func1<FileType, LoadOptions> loadOptions = new Func1<FileType, LoadOptions>() {
@Override
public LoadOptions invoke(FileType sourceType) {
if (sourceType == EmailFileType.Msg) {
EmailLoadOptions emailLoadOptions = new EmailLoadOptions();
emailLoadOptions.setConvertOwned(true);
emailLoadOptions.setConvertOwner(true);
return emailLoadOptions;
}
return null;
}
};
String source = "sample.docx";
Converter converter = new Converter(source, loadOptions);
try {
...
} finally {
converter.dispose();
}
Convert method in Converter class has new overloads
/** * Converts source document. Saves the whole converted document. * @param document The stream. * @param convertOptionsProvider Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type. */ public void convert(SaveDocumentStream document, ConvertOptionsProvider convertOptionsProvider) /** * Converts source document. Saves the whole converted document. * @param document The stream. * @param documentCompleted The delegate that receive converted document stream. * @param convertOptionsProvider Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type. */ public void convert(SaveDocumentStream document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider) /** * Converts source document. Saves the whole converted document. * @param document The delegate that saves converted document to a stream. * @param convertOptions The convert options specific to desired target file type. */ public void convert(SaveDocumentStreamForFileType document, ConvertOptions convertOptions) /** * Converts source document. Saves the whole converted document. * @param document The delegate that saves converted document to a stream * @param documentCompleted The delegate that receive converted document stream * @param convertOptions The convert options specific to desired target file type */ public void convert(SaveDocumentStreamForFileType document, ConvertedDocumentStream documentCompleted, ConvertOptions convertOptions) /** * Converts source document. Saves the whole converted document. * @param document The delegate that saves converted document to a stream. * @param convertOptionsProvider Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type. */ public void convert(SaveDocumentStreamForFileType document, ConvertOptionsProvider convertOptionsProvider) /** * Converts source document. Saves the whole converted document. * @param document The delegate that saves converted document to a stream. * @param documentCompleted The delegate that receive converted document stream. * @param convertOptionsProvider Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type. */ public void convert(SaveDocumentStreamForFileType document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider) /** * Converts source document. Saves the converted document page by page. * @param document The output stream. * @param convertOptions The convert options specific to desired target file type. */ public final void convertPageByPage(final OutputStream document, final ConvertOptions convertOptions) /** * Converts source document. Saves the converted document page by page. * @param document The output stream. * @param documentCompleted The delegate that receive converted document page stream. * @param convertOptions The convert options specific to desired target file type. */ public void convert(final OutputStream document, ConvertedPageStream documentCompleted, final ConvertOptions convertOptions) /** * Converts source document. Saves the converted document page by page. * @param document The output stream. * @param convertOptionsProvider Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type. */ public void convert(final OutputStream document, ConvertOptionsProvider convertOptionsProvider) /** * Converts source document. Saves the converted document page by page. * @param document The delegate that saves converted document page to a stream. * @param documentCompleted The delegate that receive converted document page stream. * @param convertOptions The convert options specific to desired target file type. */ public void convert(SavePageStreamForFileType document, ConvertedPageStream documentCompleted, final ConvertOptions convertOptions) /** * Converts source document. Saves the converted document page by page. * @param document The delegate that saves converted document to a stream. * @param convertOptionsProvider Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type. */ public void convert(SavePageStreamForFileType document, ConvertOptionsProvider convertOptionsProvider) /** * Converts source document. Saves the converted document page by page. * @param document The delegate that saves converted document page to a stream. * @param documentCompleted The delegate that receive converted document page stream. * @param convertOptionsProvider Convert options provider. Will be called for each conversion to provide specific convert options to desired target document type. */ public void convert(final SavePageStreamForFileType document, ConvertedPageStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
Usage
Func1<FileType, LoadOptions> loadOptionsProvider = new Func1<FileType, LoadOptions>() { @Override public LoadOptions invoke(FileType sourceType) { if (sourceType == EmailFileType.Msg) { EmailLoadOptions emailLoadOptions = new EmailLoadOptions(); emailLoadOptions.setConvertOwned(true); emailLoadOptions.setConvertOwner(true); return emailLoadOptions; } return null; } }; SaveDocumentStream stream = new SaveDocumentStream() { @Override public Stream invoke() { return new FileStream("converted-{index++}.{targetType.Extension}", FileMode.Create); } }; ConvertOptionsProvider convertOptionsProvider = new ConvertOptionsProvider() { @Override public ConvertOptions invoke(String sourceDocumentName, FileType sourceType) { if (sourceType == WordProcessingFileType.Doc) { ImageConvertOptions result = new ImageConvertOptions(); result.setFormat(ImageFileType.Tiff); return result; } else if (sourceType == EmailFileType.Msg) { return new PdfConvertOptions(); } else if (sourceType == ImageFileType.Png) { ImageConvertOptions result = new ImageConvertOptions(); result.setFormat(ImageFileType.Jpeg); return result; } return new PdfConvertOptions(); } }; String source = "sample.docx"; Converter converter = new Converter(source, loadOptionsProvider); try { Converter.convert(stream, convertOptionsProvider); } finally { converter.dispose(); }
New delegates are introduced
/** * Describes delegate for saving converted document into stream. */ public abstract class SaveDocumentStreamForFileType /** * <p> * Saves converted document into stream. * </p> * @param fileType Converted document type * @return Must return a stream where the converted document will be saved */ public abstract Stream invoke(FileType fileType); ** * Describes delegate for saving converted document page into stream. */ public abstract class SavePageStreamForFileType /** * <p> * Saves converted document page into stream. * </p> * @param pageNumber Converted page number * @param fileType Converted document type * @return Must return a stream where the converted document page will be saved */ public abstract Stream invoke(int pageNumber, FileType fileType) /** * Describes delegate to provide convert options for specific source document. * The delegate will be called before each conversion and provide a chance to provide specific convert options for desired target conversion. * The decision could be made based on provided source file name and source file type. */ public abstract class ConvertOptionsProvider /** * <p> * Provides convert options for specific source document. * </p> * * @param sourceDocumentName Source file name * @param sourceType Source file type * @return Must return ConvertOptions to be used for conversion of FileType sourceType< document */ public abstract ConvertOptions invoke(String sourceDocumentName, FileType sourceType)
FormatingOptions in PdfOptions class is marked as obsolete FormattingOptions must be used
DefaultFont in GroupDocs.Conversion.ConverterSettings class is marked as obsolete DefaultFont in specific ConvertOptions instance must be used.
ConvertAttachments in EmailLoadOptions class is marked as obsolete ConvertOwned must be used
Introduced new class GroupDocs.Conversion.Contracts.PersonalStorageDocumentInfo
/** * Contains personal storage document metadata */ public class PersonalStorageDocumentInfo extends DocumentInfo { public PersonalStorageDocumentInfo(PersonalStorage storage, FileType format, long size) /** * Is storage password protected */ public boolean isPasswordProtected() /** * Root folder name * * @return Root folder name */ public String getRootFolderName() /** * Get count of contents in the root folder * * @return count of contents in the root folder */ public int getContentCount() /** * Folders in the storage * * @return Folders in the storage */ public List<String> getFolders() }
Usage
String source = "ContactsExport.pst"; Converter converter = new Converter(source); try { IDocumentInfo documentInfo = converter.getDocumentInfo(); PersonalStorageDocumentInfo pstInfo = (PersonalStorageDocumentInfo) documentInfo; for(String folder : pstInfo.getFolders()) { System.out.println(folder); } } finally { converter.dispose(); }
Introduced new property in class XmlLoadOptions
/** * Use Xml document as data source * @return true if use */ public boolean isUseAsDataSource() /** * Set use Xml document as data source * @param useAsDataSource use Xml document as data source */ public void setUseAsDataSource(boolean useAsDataSource)
Usage
String source = "sample.xml"; Converter converter = new Converter(source, new Func1<FileType, LoadOptions>() { @Override public LoadOptions invoke(FileType arg) { XmlLoadOptions loadOptions = new XmlLoadOptions(); loadOptions.setUseAsDataSource(true); return loadOptions; } }); try { SpreadsheetConvertOptions options = new SpreadsheetConvertOptions(); converter.convert("converted.xlsx" , options); } finally { converter.dispose(); }