Bug: System.NullReferenceException when saving Pdf

Hello,
When saving as Pdf:

PngImage.Save(dest, PdfSaver)

with this save options:

Public Function PdfSaver() As Imaging.ImageOptions.PdfOptions
    PdfSaver = New Aspose.Imaging.ImageOptions.PdfOptions
    PdfSaver.KeepMetadata = True
    PdfSaver.PdfCoreOptions.Compression = Aspose.Imaging.ImageOptions.PdfImageCompressionOptions.Auto
    PdfSaver.PdfCoreOptions.JpegQuality = 75
    PdfSaver.PdfCoreOptions.PdfCompliance = Aspose.Imaging.PdfComplianceVersion.Pdf15
End Function

I will get System.NullReferenceException 3 times on all PdfCoreOptions lines.
Am I doing something wrong or there’s a bug?
Thanks

@australian.dev.nerds , we did not manage to reproduce the issue using a random image file. Could you share the used product version or specific image sample that causes described error?

1 Like

WindowsApplication1.zip (7.0 MB)

@australian.dev.nerds , we will review the attachments and give a feedback shortly!

@australian.dev.nerds , you get NullReferenceException because you did not initialize PdfOptions.PdfCoreOptions:

new PdfOptions
{
    PdfCoreOptions = new PdfCoreOptions
    {
        JpegQuality = 75,
        Compression = PdfImageCompressionOptions.Auto,
        PdfCompliance = PdfComplianceVersion.Pdf15,
    }
};