"GrapeCity.Documents.Pdf causing Null Exception

Posted by: sharif.yazdian2 on 3 July 2025, 3:06 pm EST

  • Posted 3 July 2025, 3:06 pm EST - Updated 3 July 2025, 3:11 pm EST

    We are using

        <PackageReference Include="GrapeCity.Documents.Imaging" Version="6.2.5" />
        <PackageReference Include="GrapeCity.Documents.Pdf" Version="6.2.5" />
        <PackageReference Include="GrapeCity.Documents.Word" Version="6.2.5" />
        <PackageReference Include="GrapeCity.Documents.Word.Layout" Version="6.2.5" />


    in our Azure Function.

    While running in local machine and tracing it, we have to manipulate a WORD file and for generating a PDF file based on WORD document, we get the image null exception error.

    This doesn’t happen in our colleague machine, but it happens in my machine with the same code.

  • Posted 3 July 2025, 11:58 pm EST

    Hi,

    Based on the attached screenshot, the issue appears to occur during the processing of the template Word document using DsWord. Please note that this issue is not related to DsPdf.

    Since the issue is specific to a single machine and does not reproduce on others, we recommend verifying the data source on both machines. To handle the NullPointerException, you can also use the following configuration:

    GcWordDocument_Instance.DataTemplate.Options.ExpressionNullsHandling = DataTemplateExpressionNullsHandling.Relaxed;
    

    If the issue persists, kindly share the following for further investigation:

    • A minimal sample that reproduces the issue.
    • The input Word file(s) and the corresponding data source.

    Additionally, we request that DsWord-related queries be raised on the DsWord Forums, which helps us manage and address cases more efficiently.

    References:

    Kind Regards,

    Chirag Gupta

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels