Converting WMF to PDF gives exception Image Export Fail

Using Imaging 18.9 for Java. Failing to convert a WMF to PDF. Code, stack dump and original file attached.

Image image = Image.load(inputPath);
WmfImage bmpImage = (WmfImage) 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: Expected MetafileRasterizationOptions type.
com.aspose.imaging.internal.fC.af.a(Unknown Source)
com.aspose.imaging.internal.fC.af.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.wmf.WMF2PDF.convert(WMF2PDF.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.wmf.WMF2PDF.convert(WMF2PDF.java:16)
com.deepsecure.sidecar.translation.conversions.Conversion.main(Conversion.java:39)

bomb.wmf.zip (4.3 KB)

@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-1113 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.

@simon.wiseman,

We have investigated the issue further on our end. Actually, you have used old metafile engine which can not export to PDF. I suggest that you may please use following code:

Image image = Image.load("source.wmf");
try
{
    PdfOptions pdfOptions = new PdfOptions();
    EmfRasterizationOptions opt = new EmfRasterizationOptions();
    opt.setPageSize(Size.to_SizeF(image.getSize()));
    pdfOptions.setVectorRasterizationOptions(opt);
    image.save("source.wmf.pdf", pdfOptions);
}
finally
{
    image.close();
}

Please share if there is still an issue on your end.