Aspose.Imaging EMF to PDF conversion not working


#1

Our team is leveraging the EMF to PDF converting feature. I wrote the code as below. For the five .emf files I tested, only two of them got converted successfully. For the rest of files, I saw a pdf file got generated but its size is 0, and I couldn’t open it of course. Can anyone help me with it?
We purchased Enterprise license and support.
OrderID: 181002233230

  try {
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        Instant convertStart = Instant.now();
        MetaImage image =
                (MetaImage) Image.load(inputStream, new MetafileLoadOptions(true));
        EmfRasterizationOptions emfRasterization =
                new EmfRasterizationOptions();
        emfRasterization.setPageWidth(image.getWidth());
        emfRasterization.setPageHeight(image.getHeight());
        emfRasterization.setBackgroundColor(Color.getWhiteSmoke());
        PdfOptions pdfSaveOptions = new PdfOptions();
        pdfSaveOptions.setVectorRasterizationOptions(emfRasterization);
        //image.save(byteArrayOutputStream, pdfSaveOptions);
        image.save("C:\\Users\\sqi\\Documents\\testingFiles\\result\\1.pdf ", pdfSaveOptions);
        Instant convertEnd = Instant.now();
        log.debug("EMF to PDF conversion took: {}", Duration.between(convertStart, convertEnd));
        return byteArrayOutputStream;
    } catch (Throwable e) {
        throw e;
    } finally {
        log.debug("EMF to PDF conversion is ended");
    }

We are using Java 1.8
Below are the files didn’t get converted successfully.
testing files.zip (296.7 KB)

Can anyone please help? This is very urgent.

Thanks,
Simone


#2

@simoneqqq,

I have worked with the image file shared by you and have been able to observe the issue specified. An issue with ID IMAGINGJAVA-1105 has been created in our issue tracking system to investigate and resolve the issue. We will notify you once the issue will be fixed.


#3

Thanks so much. We’ll wait for the fix.


#4

Hi Adnan,

Could you please let us know the ETA on this issue? We are due in 3 weeks.

Thanks,
Simone


#5

@simoneqqq,

I regret to share that the issue specified is not yet resolved because issue is added recently in our issue tracking system. Actually, in Aspose.Imaging forum the issues are selected for investigation on first come first serve basis. Also the first priority for scheduling and resolution is given to paid Enterprise and priority support customers. Then Aspose.Imaging normal or free support customers issues are scheduled and resolved on first come and first come serve basis. I will share the further information with you as soon as the issue will be resolved.


#6

Got a similar sounding problem, except I get a stack dump.
Using Imaging 18.9 for Java.
Code, stack dump and sample image attached.

Image image = Image.load(inputPath);
EmfImage bmpImage = (EmfImage) image;
PdfOptions pdfOptions = new PdfOptions();
bmpImage.save(outputPath, pdfOptions);

class com.aspose.imaging.coreexceptions.ImageSaveException: Image export failed. —> class com.aspose.imaging.internal.Exceptions.ArgumentException: Expect valid EmfRasterizationOptions instance for VectorRasterizationOptions property of PdfOptions.
com.aspose.imaging.internal.fC.k.a(Unknown Source)
com.aspose.imaging.internal.fD.d.a(Unknown Source)
com.aspose.imaging.internal.fD.d.a(Unknown Source)
com.aspose.imaging.internal.fC.L.b(Unknown Source)
com.aspose.imaging.internal.fC.a.a(Unknown Source)
com.aspose.imaging.internal.fC.a.export(Unknown Source)
com.aspose.imaging.Image.a(Unknown Source)
com.aspose.imaging.Image.save(Unknown Source)
com.aspose.imaging.Image.save(Unknown Source)
com.deepsecure.sidecar.translation.conversions.image.emf.EMF2PDF.convert(EMF2PDF.java:16)
com.deepsecure.sidecar.translation.conversions.Conversion.main(Conversion.java:39)
— End of inner exception stack trace —
com.aspose.imaging.Image.a(Unknown Source)
com.aspose.imaging.Image.save(Unknown Source)
com.aspose.imaging.Image.save(Unknown Source)
com.deepsecure.sidecar.translation.conversions.image.emf.EMF2PDF.convert(EMF2PDF.java:16)
com.deepsecure.sidecar.translation.conversions.Conversion.main(Conversion.java:39)

image10.emf.zip (2.4 MB)


#7

@simon.wiseman

I have worked with the sample file shared by you and have been able to observe the issue specified. An issue with ID IMAGINGJAVA-1111 has been created in our issue tracking system to investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once issue will be fixed.


#8

@mudassir.fayyaz thanks so much for your information. I’ll keep an eye on it.

Best,
Simone


#9

@simoneqqq,

You are welcome. We will share updates with you as soon as the issue will be fixed.


#10

May I get some update from you about this issue? We are still waiting on it.

Thanks,
Simone


#11

@mudassir.fayyaz
I just noticed our company does have Enterprise license to Aspose.Total, full suite, and also we paid the Enterprise Support. Can you transfer this ticket to the paid support? Can anyone contact person from Aspose reach out to me?

OrderID: 181002233230

Thanks,
Simone


#12

@simoneqqq,

You may please need to log separate ticket in Paid support helpdesk if you have subscribed for paid support. Please visit paid support helpdesk for reference. You can mentioned ticket IDs associated with this thread there for resolution of priority basis.


#13

Thanks @mudassir.fayyaz I just created a the paid support ticket.