We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Text automatically unwrap while converting CDR to JPG

When I am converting cdr file to jpg. The paragraph in cdr automatically unwrap and get out of the image. but while converting from online platform of aspose the output is correct.
Here is my code:

CdrImage image = Image.load(inputFileName);
JpegOptions options = new JpegOptions();
VectorRasterizationOptions rasterizationOptions = (VectorRasterizationOptions) image.getDefaultOptions(new Object[]{Color.getWhite(), image.getWidth(), image.getHeight()});
rasterizationOptions.setPositioning(PositioningTypes.DefinedByDocument);
options.setVectorRasterizationOptions(rasterizationOptions);

	for(int i = 1; i<((IMultipageImage)image).getPageCount(); i++) {
		
		options.setMultiPageOptions(new MultiPageOptions(new IntRange(i, 1))); //initial  pages
		
		image.save("C:\\Users\\admin\\Desktop\\cdr\\02-Adimission form " + i + ".jpg", options);
		
	}

Here is the output from code: 02-Adimission form 1.jpg (101.1 KB)

Here is the output from aspose online : 02-Adimission form.cdr_p2.jpg (129.2 KB)

Here is the Input File : https://drive.google.com/file/d/165d3UGJR5Qm0uWHf3Vuemb5sgisj9ovu/view?usp=sharing

Kindly look at text carefully to find the difference (error)

@rohi001, you can use next code that produces file as expected result1.jpg (131.8 KB)

using (CdrImage image = (CdrImage)Image.Load(path))
            {
                VectorRasterizationOptions rasterizationOptions = new CdrRasterizationOptions();
                rasterizationOptions.PageWidth = image.Width;
                rasterizationOptions.PageHeight = image.Height;
                JpegOptions exportOptions = new JpegOptions();
                exportOptions.VectorRasterizationOptions = rasterizationOptions;
                //exportOptions.MultiPageOptions = new MultiPageOptions(new IntRange(0, image.Pages.Length));
                for (int i = 0; i < image.Pages.Length; i++)
                {
                    image.Pages[i].Save($@"c:\Users\USER\Downloads\result{i}.jpg", exportOptions);
                }
            }

the Output is same again:
I am using java programming language and Here is the code:

try (CdrImage image = (com.aspose.imaging.fileformats.cdr.CdrImage)Image.load(inputFileName))
{	    

    VectorRasterizationOptions rasterizationOptions = new CdrRasterizationOptions();
    rasterizationOptions.setPageWidth(image.getWidthF());
    rasterizationOptions.setPageHeight(image.getHeightF());
    
    JpegOptions exportOptions = new JpegOptions();
    exportOptions.setVectorRasterizationOptions(rasterizationOptions);
	
	for(Image im : image.getPages()) {
		
		im.save("C:\\Users\\admin\\Desktop\\cdr\\02-Adimission form" + ".jpg", exportOptions);
		
	}
}

Output File : 02-Adimission form 1.jpg (101.1 KB)

@rohi001
Hello! Please, let me know the version of Aspose.Imaging that you use. Last version of Aspose.Imaging for Java produces correct output.

I am using aspose.imaging 22.3 jdk16

Thats it. There was a such error in Aspose.Imaging 22.3. You need to use the last version.

Yes You’re right it’s working fine in version 22.4 also.

But, Actually I have the license valid till 21 March 2022.
So, it will be so kind of you if you can provide a solution on aspose.imaging 22.3.
or
Something else that can solve the problem.

@rohi001, unfortunately we ca not apply patches for previous releases of Aspose.Imaging. The only solution is to use versions 22.4 and higher that support work with paragraphs in cdr.