GroupDocs.Conversion for Java 17.3.0 Release Notes

Major Features

There are 26 new features, improvements and fixes in this regular monthly release. The most notable are:

  • Conversions from DjVu format
  • Conversions from EMF format
  • Conversions from WMF format
  • Conversions from DICOM format
  • Conversions from OTP format
  • Helper method to return possible conversions from file extension or stream
  • Helper method to return pages count of a document which will be converted
  • Improved progress reporting
  • Improved performance of Word to Pdf and Word to Epub conversions
  • Conversions from and to Webp format
  • Improved memory handling
  • Improved performance
  • Conversions to XPS format
  • Conversions to SVG format
  • Conversions from OTS format
  • Reduced memory usage
  • Conversions to specific PDF format
  • Conversions from PDF-A
  • Conversions from Mobi
  • Setting different horizontal and vertical resolution when converting to image
  • Conversions from DNG
  • Conversions from DGN
  • Conversions from VSSX and VSTX
  • Conversions from ONE
  • Option to hide WORD comments when converting from word
  • Improved performance of HTML to PDF conversions

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
CONVERSIONNET-1387Implement OTP file format conversionNew Feature
CONVERSIONNET-1413Implement DICOM file format conversionNew Feature
CONVERSIONNET-1418Implement conversion from WMFNew Feature
CONVERSIONNET-1419Implement conversion from EMFNew Feature
CONVERSIONNET-1447Count total pages of a documentNew Feature
CONVERSIONNET-1458Return all possible conversions from file extension or streamNew Feature
CONVERSIONNET-1425Implement conversion from DjVuNew Feature
CONVERSIONNET-1480Implement conversion from WebpNew Feature
CONVERSIONNET-1483Implement conversion to WebpNew Feature
CONVERSIONNET-1683Metered licensingNew Feature
CONVERSIONNET-1585Implement conversion from OTSNew Feature
CONVERSIONNET-1598Implement conversion to grayscale imageNew Feature
CONVERSIONNET-1619Implement conversion to XPSNew Feature
CONVERSIONNET-1624Implement conversion to SVGNew Feature
CONVERSIONNET-1685Implement conversion to PDF with setting PDF file formatNew Feature
CONVERSIONNET-1693Conversion of PDF-A file to PDFNew Feature
CONVERSIONNET-1697Implement conversion from MobiNew Feature
CONVERSIONNET-1722Horizontal and Vertical resolutions for conversions to ImageNew Feature
CONVERSIONNET-1729Implement conversion from DNGNew Feature
CONVERSIONNET-1737Implement conversion from DGNNew Feature
CONVERSIONNET-1745Implement conversion from VSSX and VSTXNew Feature
CONVERSIONNET-1761Ability to hide words comments when converting from wordNew Feature
CONVERSIONNET-1760Implement conversion from ONENew Feature
CONVERSIONNET-1376Improve performance of Word to Pdf and Word to Epub conversionsImprovement
CONVERSIONNET-1400Improve progress reportingImprovement
CONVERSIONNET-1485Improve memory handlingImprovement
CONVERSIONNET-1484Progress report is not workingImprovement
CONVERSIONNET-1645Improving memory handling on saveImprovement
CONVERSIONNET-1646Improving output file name if converting from/to pageImprovement
CONVERSIONNET-1648Improve memory handling in documentsImprovement
CONVERSIONNET-1719Convert Html to Pdf improvementsImprovement
CONVERSIONNET-1399Use LZW compression for internal tiff compressionBug
CONVERSIONNET-1424Mssing “Fixedlayout” Property while Updating VB ExampleBug
CONVERSIONNET-1414File name contains extra symbolsBug
CONVERSIONNET-1518Converting to image with set DPI options without setting image width and height is producing invalid imageBug
CONVERSIONNET-1557HideWordTrackedChanges set to ‘true’ but still its showing track chnages and markupBug
CONVERSIONNET-1564Exception when loading EPUB in multithreadBug
CONVERSIONNET-1566Exception when converting DWG to PNG in multithreadBug
CONVERSIONNET-1567Exception is thrown when resizing specific Pdf fileBug
CONVERSIONNET-1158Convert to HTML from PDF - Words in Bold Letters are not properly displayedBug
CONVERSIONNET-845Pdf to Html conversion formatting issueBug
CONVERSIONNET-1568Wrong characters when saving in HTMLBug
CONVERSIONNET-1580Multipage Tiff is not converted properly to PdfBug
CONVERSIONNET-1615Page mode conversions do not workBug
CONVERSIONNET-1643HideWordTrackedChanges not respected when converting from wordBug
CONVERSIONNET-1644Dpi resolution not respected when converting Cells to ImageBug
CONVERSIONNET-1692When converting a Cell to Pdf, the sheet is split into multiple pdf pagesBug
CONVERSIONNET-1581System.ArgumentOutOfRangeException when adding shape to slide and savingBug
CONVERSIONNET-1709Converting TXT to any format with limiting pages produces wrong outputBug
CONVERSIONNET-1684Exception when trying to access SaveOptions.ConvertFileTypeBug
CONVERSIONNET-1696.tif to .png conversion is not as expectedBug
CONVERSIONNET-1597Memory leak when converting CAD stream to imageBug
CONVERSIONJAVA-210.tif to .png conversion is not as expectedBug
CONVERSIONJAVA-150% symbol in the file name trowns an exceptionBug

Public API and Backward Incompatible Changes

How to get pages count of a document which will be converted

String storagePath = "C:\storagePath";
String cachePath = "C:\cachePath";
String sourceFileName = "DOCXsample.docx"; //TODO: Put the source filename here

// Setup Conversion configuration
ConversionConfig conversionConfig = new ConversionConfig();
conversionConfig.setStoragePath(storagePath);
conversionConfig.setCachePath(cachePath);

ConversionHandler conversionHandler = new ConversionHandler(conversionConfig);

int count = conversionHandler.getDocumentPagesCount(sourceFileName);

System.out.print("Count is: " + count);

How to get possible conversions from file extension

String storagePath = "C:\storagePath";
String cachePath = "C:\cachePath";

String sourceFileName = "DOCXsample.docx"; //TODO: Put the source filename here

// Setup Conversion configuration
ConversionConfig conversionConfig = new ConversionConfig();
conversionConfig.setStoragePath(storagePath);
conversionConfig.setCachePath(cachePath);

ConversionHandler conversionHandler = new ConversionHandler(conversionConfig);
String[] possibleConversions = conversionHandler.getPossibleConversions("docx");

System.out.print("Possible conversions: " + possibleConversions);

How to get possible conversions from stream

String storagePath = "C:\storagePath";
String cachePath = "C:\cachePath";
String sourceFileName = "DOCXsample.docx"; //TODO: Put the source filename here
 
// Setup Conversion configuration
ConversionConfig conversionConfig = new ConversionConfig();
conversionConfig.setStoragePath(storagePath);
conversionConfig.setCachePath(cachePath);

ConversionHandler conversionHandler = new ConversionHandler(conversionConfig);

FileInputStream fileStream = new FileInputStream(storagePath + "/" + sourceFileName);

String[] possibleConversions = conversionHandler.getPossibleConversions(fileStream);
System.out.print("Possible conversions: " + possibleConversions);

How to convert to WebP

String storagePath = "C:\storagePath";
        
// Setup Conversion configuration
ConversionConfig conversionConfig = new ConversionConfig();
conversionConfig.setStoragePath(storagePath);

//instantiating the conversion handler
ConversionHandler conversionHandler = new ConversionHandler(conversionConfig);
ImageSaveOptions options = new ImageSaveOptions();
options.setConvertFileType(ImageSaveOptions.ImageFileType.WEBP);
options.getWebpOptions().setLossless(true);

List<GroupDocsInputStream> convertedDocumentStream = conversionHandler.<List<GroupDocsInputStream>>convert("DOCXsample.docx", options);
System.out.print("Converted file path is: " + convertedDocumentStream);

How to convert to grayscale image

String storagePath = "C:\storagePath";
        
// Setup Conversion configuration
ConversionConfig conversionConfig = new ConversionConfig();
conversionConfig.setStoragePath(storagePath);

//instantiating the conversion handler
ConversionHandler conversionHandler = new ConversionHandler(conversionConfig);
ImageSaveOptions options = new ImageSaveOptions();
options.setConvertFileType(ImageSaveOptions.ImageFileType.JPG);
options.setGrayscale(true);

List<GroupDocsInputStream> convertedDocumentStream = conversionHandler.<List<GroupDocsInputStream>>convert("DOCXsample.docx", options);
System.out.print("Converted file path is: " + convertedDocumentStream);

How to convert to SVG

String storagePath = "C:\storagePath";
        
// Setup Conversion configuration
ConversionConfig conversionConfig = new ConversionConfig();
conversionConfig.setStoragePath(storagePath);

//instantiating the conversion handler
ConversionHandler conversionHandler = new ConversionHandler(conversionConfig);
ImageSaveOptions options = new ImageSaveOptions();
options.setConvertFileType(ImageSaveOptions.ImageFileType.SVG);

List<GroupDocsInputStream> convertedDocumentStream = conversionHandler.<List<GroupDocsInputStream>>convert("DOCXsample.docx", options);

System.out.print("Converted file path is: " + convertedDocumentStream);

How to convert to XPS

String storagePath = "C:\storagePath";
        
// Setup Conversion configuration
ConversionConfig conversionConfig = new ConversionConfig();
conversionConfig.setStoragePath(storagePath);

//instantiating the conversion handler
ConversionHandler conversionHandler = new ConversionHandler(conversionConfig);

//PdfSaveOptions options = new PdfSaveOptions();
ImageSaveOptions options = new ImageSaveOptions();
options.setConvertFileType(PdfSaveOptions.PdfFileType.XPS);

List<GroupDocsInputStream> convertedDocumentStream = conversionHandler.<List<GroupDocsInputStream>>convert("DOCXsample.docx", options);
System.out.print("Converted file path is: " + convertedDocumentStream);

Metered licensing

String storagePath = "C:\storagePath";
        
// Setup Conversion configuration
ConversionConfig conversionConfig = new ConversionConfig();
conversionConfig.setStoragePath(storagePath);

// Create new instance of GroupDocs.Conversion.Metered classs
Metered metered = new Metered();

// Set public and private key to metered instance
metered.setMeteredKey(
    "***", 
    "***"
);

// Get metered value before usage of the conversion
double amountBefore = Metered.getConsumptionQuantity();
System.out.print("Amount consumed before: " + amountBefore);

//instantiating the conversion handler
ConversionHandler conversionHandler = new ConversionHandler(conversionConfig);
PdfSaveOptions options = new PdfSaveOptions();
options.setConvertFileType(PdfSaveOptions.PdfFileType.PDF);

GroupDocsInputStream convertedDocumentStream = conversionHandler.<GroupDocsInputStream>convert("DOCXsample.docx", options);

// Get metered value after usage of the conversion
double amountAfter = Metered.getConsumptionQuantity();
System.out.print("Amount consumed after: " + amountAfter);

How to hide comments when converting from Words

String storagePath = "C:\storagePath";
String cachePath = "C:\cachePath";
        
// Setup Conversion configuration
ConversionConfig conversionConfig = new ConversionConfig();
conversionConfig.setStoragePath(storagePath);
conversionConfig.setCachePath(cachePath);
ConversionHandler conversionHandler = new ConversionHandler(conversionConfig);

// Save options
SaveOptions saveOptions = new PdfSaveOptions();
saveOptions.setOutputType(OutputType.String);
saveOptions.setHideWordComments(false);

String result = conversionHandler.<String>convert(sourceFileName, saveOptions);

System.out.print("Converted file path is: " + result);

ImageSaveOptions.Dpi is marked as obsolete

String storagePath = @"c:\Worx\aspose\sources\GroupDocs.Conversion.Test\SampleFiles";
        
// Setup Conversion configuration
ConversionConfig conversionConfig = new ConversionConfig();
conversionConfig.setStoragePath(storagePath);

//instantiating the conversion handler
ConversionHandler conversionHandler = new ConversionHandler(conversionConfig);
ImageSaveOptions options = new ImageSaveOptions();
options.setConvertFileType(ImageSaveOptions.ImageFileType.TIFF);
// Dpi is obsolete, now horizontal and vertical resolutions can be set independently
options.setHorizontalResolution(96);
options.setVerticalResolution(96);

List<GroupDocsInputStream> convertedDocumentStream = conversionHandler.<List<GroupDocsInputStream>>convert("DOCXsample.docx", options);

System.out.print("Converted file path is: " + convertedDocumentStream);