Checkboxes not rendering in Table Cell for Aspose.PDF.NET

We currently have an issue where checkboxes are not rendering in a table cell. We believe that part of our issue is the server that renders the PDF document is a Linux server. Local development (Windows PC) everything renders fine, but once we push it up to our DEV or QA environments (Linux servers), the checkboxes no longer render. We found some forums online where it was mentioned to install the MS Wingdings fonts on the Linux box, but this did not resolve our issue. We are hoping that you have a solution for us. We are currently using Aspose.PDF v23.9.0 (for .NET).

@jjwynes

Instead of using Aspose.PDF for .NET, can you please try to use the latest package of Aspose.Pdf.Drawing from NuGet Gallery? In case you still notice any issues, please let us know by sharing your sample code snippet and complete environment details. We will further proceed to assist you accordingly.

I removed Aspose.PDF and am only referencing the Aspose.PDF.Drawing package, and this is still not working. The application is a .net 6 app that is published on a Linux server on AWS.

I have created a C# library that is a wrapper around aspose library. Basically I am trying to add a Checkbox to a Table cell.

if (tableColumnComponent.Checkbox != null)
{
    cell.Paragraphs.Add(BuildCheckbox(tableColumnComponent.Checkbox));
}

this calls the BuildCheckbox method:

private static CheckboxField BuildCheckbox(CheckboxComponent component)
{

    CheckboxField checkboxField = new(currentPage, new Rectangle(10, 10, 10, 10))
    {
        TextHorizontalAlignment = (Aspose.Pdf.HorizontalAlignment)(int)component.TextHorizontalAlignment,
        Margin = BuildMargin(component.Margin),
        VerticalAlignment = (Aspose.Pdf.VerticalAlignment)(int)component.VerticalAlignment,
        Width = component.Width,
        Height = component.Height,
        AlternateName = component.FieldName,
    };
    if (component.HasBorder)
    {
        checkboxField.Border = new(checkboxField)
        {
            Width = 1,
            Style = BorderStyle.Solid
        };
    }
    checkboxField.Checked = component.Checked;
    checkboxField.Color = BuildColor(component.TextColor);
    checkboxField.Characteristics.Border = System.Drawing.Color.Black;

    asposeDocument!.Form.Add(checkboxField);

    return checkboxField;

}

What is very strange is I can call the API endpoint that returns the the PDF file by using Postman and it generates the checkboxes just fine, but the minute we call the same endpoint from our web app, it doesn’t render the checkboxes in the downloaded file.

@jjwynes

Can you please share the PDF files (generated from Postman call and from the deployed application) for our reference? We will test the scenario in our environment and address it accordingly.

postman_response.pdf (466.3 KB)

10_30_2023_batch_report.pdf (68.1 KB)

@jjwynes

It looks like your shared two different documents. Meaning, one document is generated from Aspose.PDF which is apparently obtained using postman call (postman_response.pdf) while other one (10_30_2023_batch_report.pdf) is generated from iTextSharp and apparently obtained from the web application directly. Can you please clarify this? The document directly from your web app should also be generated from Aspose.PDF if you are hitting same endpoint.

Thank you for your response. Apparently on our server side we have a process that runs in batches for our reports. Our users have options of “bundling” reports, so they are using iTextSharp for that bundling and/or merging. My guess is iTextSharp doesn’t play nicely with Aspose created PDF files. We are doing more exploring on our end to get this working correctly. Thank you for your help, and if I run into anymore issues I will reach back out.

@jjwynes

Sure, please take your time and feel free to let us know if you need any kind of assistance.