Empty EMF to PDF - reoccurring error

When an empty EMF file is converted to PDF, a reoccurring error is outputted.

Code:
Image document = Image.load(inputPath);
PdfOptions options = new PdfOptions();
document.save(outputPath, options);

Errors outputted:
image.png (5.3 KB)

Original “empty” EMF:
sample.zip (118 Bytes)

A “normal/not empty” EMF converts successfully to PDF using the code shown above.

@simon.wiseman

I have created a ticket with ID IMAGINGJAVA-2032 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.

The issues you have found earlier (filed as IMAGINGJAVA-2032) have been fixed in this update.

I no longer see the large output of logs when I translate an empty EMF to PDF.
Please check the logs in the attached screenshot below and let me know if they are what is expected - thanks.

Capture.PNG (8.0 KB)

@simon.wiseman

The problem is the empty source file.

String f = "sample.emf";

try 
{
    Image document = Image.load(f);
    PdfOptions options = new PdfOptions();
    document.save(f + ".pdf", options);
    document.close();
}
catch (ImageLoadException e)
{
    if (!e.getMessage().equals("Cannot open an image. The image size can not be 0!"))
        throw e;
}

System.out.println("Everything is OK!");

sample.emf.zip (746 Bytes)