Completed
Last Updated: 29 Jul 2022 15:05 by ADMIN
Release R3 2022
Michael
Created on: 25 Jul 2022 07:23
Category: PdfProcessing
Type: Bug Report
0
PdfProcessing: Hidden fields with pushButton widget become visible when using FlattenFormFields method to flatten fields

Hidden fields with pushButton widget become visible when using FlattenFormFields method to flatten fields.

Workaround: do not flatten fields if the IsHidden property of any of its Widget's is set to True:

 var fieldsList = formFields.ToList();
 for (int i = 0; i < fieldsList.Count; i++)
 {
     var field = fieldsList[i];
     bool flattenCurrentField = true;
     if (field.FieldType == FormFieldType.PushButton)
     {
         PushButtonField pushButtonField = (PushButtonField)field;
         PushButtonWidget[] widgets = pushButtonField.Widgets.ToArray();

         foreach (var widget in widgets)
         {
             var baseType = typeof(PushButtonWidget).BaseType.BaseType.BaseType;
             PropertyInfo[] properties = baseType.GetProperties(BindingFlags.NonPublic | BindingFlags.Instance);
             PropertyInfo isHidden = properties.FirstOrDefault(p => p.Name == "IsHidden");
             bool value = (bool)isHidden.GetValue(widget);
             if (value == true)
             {
                 flattenCurrentField = false;
                 break;
             }
         }
     }

     if (flattenCurrentField)
     {
         document.AcroForm.FlattenFormField(field);
     }
 }

 

1 comment
ADMIN
Peshito
Posted on: 29 Jul 2022 15:05

Hello,

This item will be available in R3 2022 Release. 

It is also available with Telerik UI for WPF's latest internal build - LIB 2022.2.801 (01 Aug 2022) if you need it earlier.

Regards,
Peshito
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.