We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Delete fields functionality doesn't work

Hello,

Could you please help me to delete radio button options? It seems like field remove functionality doesn’t work in appropriate way. I have three radio buttons on my file. Here is my code sample:

using (Aspose.Pdf.Document document = new Aspose.Pdf.Document(@"C://result.pdf"))
{
    var fields = document.Form.Fields.ToList();
    var editor = new FormEditor();
    editor.BindPdf(document);

    foreach (var field in fields)
    {
        document.Form.Delete(field);
        editor.RemoveField(field.Name);
        editor.DelListItem(field.Name, field.ToString());
    }
    document.Save(@"C://without_fields.pdf");
}

Am I doing something wrong? Cause none of these methods work for me…

files.zip (13.0 KB)
result.png (36.2 KB)

@vitaliy1924

We were able to notice that API was unable to delete the form fields from the PDF when we tested the scenario using 21.7 version of the API at our end. Hence, we have logged an issue as PDFNET-50268 in our issue tracking system for further investigation. We will look into its details and keep you posted with the status of its rectification. Please be patient and spare us some time.

We are sorry for the inconvenience.