Aspose.Imaging for Java 22.11 - Release notes

Competitive features:

  • Integration Aspose.Fonts into Aspose.Imaging
  • Reworked memory allocation management - the shared memory approach was replaced by a buffered file cache and it resolves the issue of abandoned temporary files
IMAGINGJAVA-8291Integration Aspose.Fonts into Aspose.ImagingFeature
IMAGINGJAVA-8290Emf to PNG not properly convertedEnhancement
IMAGINGJAVA-8289Cannot load WEBP imageEnhancement
IMAGINGJAVA-8284Cannot convert the DICOM image to APNGEnhancement
IMAGINGJAVA-8280Fix Emf formulas rasterizationEnhancement
IMAGINGJAVA-8267Cannot convert EMF to SVGEnhancement
IMAGINGJAVA-8266CDR to JPG conversion errorEnhancement

Public API changes:

Added APIs:

Please see corresponding cumulative API changes for Aspose.Imaging for .NET 22.11 version

Removed APIs:

Please see corresponding cumulative API changes for Aspose.Imaging for .NET 22.11 version

Usage Examples:

IMAGINGJAVA-8291 Integration Aspose.Fonts into Aspose.Imaging

This example demonstrates the possibility of direct access to the character index by bypassing the Unicode table.
This feature is supported by the Emf format.
Here the line: *text.getWEmrText().setOptions(EmfExtTextOutOptions.ETO_GLYPH_INDEX);*
Indicates that characters are accessed via GlyphIndex

**The font must be the one specified such as in the example. Because glyphIndex in each font corresponds to a different character.**

final String baseFolder = "D:\\Test\\";
final String fontName = "Cambria Math";
final int symbolCount = 40; //count symbols in the example
final int startIndex = 2001; //start GlyphIndex for example
String fontFolder = baseFolder + "Fonts"; //font folder

//Fill GlyphIndex buffer
int[] glyphCodes = new int[symbolCount];
for (int i = 0; i < symbolCount; i++)
	glyphCodes[i] = startIndex + i;

//create emf
try (EmfImage emf = new EmfImage(700, 100))
	//font record
	EmfExtCreateFontIndirectW font = new EmfExtCreateFontIndirectW();
	font.setElw(new EmfLogFont());

	//text record
	EmfExtTextOutW text = new EmfExtTextOutW();
	text.setWEmrText(new EmfText());
	text.getWEmrText().setOptions(EmfExtTextOutOptions.ETO_GLYPH_INDEX); //symbols index as GlyphIndex
	text.getWEmrText().setChars(symbolCount); //string length
	text.getWEmrText().setGlyphIndexBuffer(glyphCodes); //index buffer

	emf.getRecords().add(font); //add font
	final EmfSelectObject emfSelectObject = new EmfSelectObject();
	emf.getRecords().add(emfSelectObject); //select font
	emf.getRecords().add(text); //add text + "result.png"); //rendering

IMAGINGJAVA-8290 Emf to PNG not properly converted

try (Image image = Image.load("D:\\test-1.emf"))

IMAGINGJAVA-8284 Cannot convert the DICOM image to APNG

try (Image image = Image.load("input.dcm"))
{"output.png", new ApngOptions());

IMAGINGJAVA-8267 Cannot convert EMF to SVG

String baseFolder = "D:\\";
String file = "file.emf";
String inputFileName = baseFolder + file;
String outputFileName = inputFileName + ".svg";
try (Image image = Image.load(inputFileName))
{, new SvgOptions());

IMAGINGJAVA-8266 CDR to JPG conversion error

try (Image image = Image.load("BANNER HAFLAH RA 2022.cdr"))
 {"result.png", new PngOptions()
         setVectorRasterizationOptions(new CdrRasterizationOptions()