Yes, this issue has been marked as resolved in upcoming Aspose.Imaging for .NET 19.12. We will share the good news with you as soon as the product will be shared online.
Thanks for the update. Is the issue is going to be resolved for Aspose.Imaging for Java as well in version 19.12?
Can you please tell me what are the things we can do with CDR Files using aspose imaging for java. Am not able to find proper documentation/ sample for CDR files. Is it possible to preview CDR files & convert CDR file to PDF using aspose imaging library
I suggest you to please try using following sample code on your end to serve the purpose using Aspose.Imaging for Java 19.12.
public void exportToPdf(String inputCdrFileName, String outputPdfFileName)
{
Image image = Image.load(inputCdrFileName);
try
{
PdfOptions pdfOptions = new PdfOptions();
CdrRasterizationOptions rasterizationOptions = new CdrRasterizationOptions();
rasterizationOptions.setTextRenderingHint(TextRenderingHint.SingleBitPerPixel);
rasterizationOptions.setSmoothingMode(SmoothingMode.None);
rasterizationOptions.setPositioning(PositioningTypes.DefinedByDocument);
pdfOptions.setVectorRasterizationOptions(rasterizationOptions);
image.save(outputPdfFileName, pdfOptions);
}
finally
{
image.close();
}
}
Thanks @mudassir.fayyaz for sharing the code. I tried it but getting the following exception
class com.aspose.imaging.coreexceptions.ImageLoadException: Image saving failed. —> java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/geom/Dimension2D;
Sample file link:
Sorry to say there is lot of scope of improvement in documentation & example provided on github.
I tried to PSD example but getting exception as well. I will suggest to retest examples . provided on github.
Can you please let me know is it possible to get bitmap from Image object to display in imageview in android?
I have observed the issue shared by you with newly shared file. It seems to be an issue with API while loading attached file. An issue with ID IMAGINGJAVA-1520 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.
I am afraid at present the API does not support in case of Android platforms.
Any update on this issue. I raised the issue in September you said will be resolved with release in December end. It’s still not resolved. Quite frustrating to wait.
I have verified from our issue tracking system and like to share that issue has been marked as resolved in upcoming version. We will share the notification with you as soon as the issue will be fixed. I also suggest you to please try using latest Aspose.Imaging 19.12 on your end as well.
I have already tried the Imaging 19.12 for Java & got the following error:
class com.aspose.imaging.coreexceptions.ImageLoadException: Image saving failed. —> java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/geom/Dimension2D
We will share the good news with you as soon as the issue will be fixed in upcoming version. I request for your patience in this regard.
This issue is going to be resolved or not waiting since September 2019?
We have tested using Aspose.Imaging for .NET 19.12. Following code works fine without any errors. In our view the error you got could be appeared only in Android but currently Aspose.Imaging for Java can not work in Android.
Image image = Image.load("tiger1.cdr");
try
{
PdfOptions pdfOptions = new PdfOptions();
CdrRasterizationOptions rasterizationOptions = new CdrRasterizationOptions();
rasterizationOptions.setTextRenderingHint(TextRenderingHint.SingleBitPerPixel);
rasterizationOptions.setSmoothingMode(SmoothingMode.None);
rasterizationOptions.setPositioning(PositioningTypes.DefinedByDocument);
pdfOptions.setVectorRasterizationOptions(rasterizationOptions);
image.save("tiger1.cdr.pdf", pdfOptions);
}
finally
{
image.close();
}
tiger1.cdr.pdf (902.5 KB)
I am using Imaging 21.2 and tried to convert a cdr to pdf with following code:
com.aspose.imaging.Image doc = com.aspose.imaging.Image.load(cdrname);
com.aspose.imaging.imageoptions.PdfOptions pdfOptions = new com.aspose.imaging.imageoptions.PdfOptions();
CdrRasterizationOptions rasterizationOptions = new CdrRasterizationOptions();
rasterizationOptions.setTextRenderingHint(TextRenderingHint.SingleBitPerPixel);
rasterizationOptions.setSmoothingMode(SmoothingMode.None);
rasterizationOptions.setPositioning(PositioningTypes.DefinedByDocument);
pdfOptions.setVectorRasterizationOptions(rasterizationOptions);
doc.save(pdfName, pdfOptions);
What happens? I get a pdf-File consisting of 4 nice looking pages but I also get an exception:
Exception in thread “main” class com.aspose.imaging.coreexceptions.ImageSaveException: Image export failed. —> class com.aspose.imaging.internal.Exceptions.IO.IOException: Attempted to seek before start of MemoryStream.
com.aspose.imaging.system.io.MemoryStream.seek(Unknown Source)
com.aspose.imaging.internal.bg.y.a(Unknown Source)
com.aspose.imaging.internal.bg.y.a(Unknown Source)
com.aspose.imaging.internal.be.a.a(Unknown Source)
com.aspose.imaging.internal.be.a.a(Unknown Source)
com.aspose.imaging.internal.be.a.a(Unknown Source)
com.aspose.imaging.internal.be.a.a(Unknown Source)
com.aspose.imaging.internal.be.a.a(Unknown Source)
com.aspose.imaging.internal.be.a.a(Unknown Source)
com.aspose.imaging.internal.be.a.a(Unknown Source)
com.aspose.imaging.internal.be.a.a(Unknown Source)
com.aspose.imaging.internal.be.a.a(Unknown Source)
com.aspose.imaging.internal.be.a.a(Unknown Source)
com.aspose.imaging.internal.be.a.a(Unknown Source)
com.aspose.imaging.internal.be.a.a(Unknown Source)
com.aspose.imaging.internal.be.a.a(Unknown Source)
com.aspose.imaging.internal.be.a.c(Unknown Source)
com.aspose.imaging.fileformats.cdr.CdrImagePage.cacheData(Unknown Source)
com.aspose.imaging.fileformats.cdr.CdrImagePage.getWidth(Unknown Source)
com.aspose.imaging.Image.getSize(Unknown Source)
com.aspose.imaging.internal.aG.g.a(Unknown Source)
com.aspose.imaging.fileformats.cdr.CdrImagePage.a(Unknown Source)
com.aspose.imaging.internal.aG.N.a(Unknown Source)
com.aspose.imaging.internal.aG.y.a(Unknown Source)
com.aspose.imaging.internal.aG.t.a(Unknown Source)
com.aspose.imaging.internal.aG.t.b(Unknown Source)
com.aspose.imaging.internal.aG.t.export(Unknown Source)
com.aspose.imaging.Image.a(Unknown Source)
com.aspose.imaging.Image.save(Unknown Source)
com.aspose.imaging.Image.save(Unknown Source)
What can I do now?
Can you please share the source file reproducing the issue on your end that we can use to vaeify.
Thank you for sharing the information. I have added a ticket with ID IMAGINGJAVA-2061 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.
Sorry for the delay. I waited for an answer of my customer. See the attached file please.Trakt_7_-Umbau_Drehtrommelt__r-03-_Konzept.cdr.pdf (487.3 KB)