Completed
Last Updated: 15 May 2024 06:30 by ADMIN
Release 2024.2.426 (2024 Q2)
Abhi
Created on: 24 Jul 2023 05:52
Category: PdfProcessing
Type: Bug Report
4
PdfProcessing: Form fields height is wrong after export with a specific document

I have the following form:

From the screen shot above you can see that the line above 75 is perfectly ok i.e. it doesn't go and intersect with the lines of the 72

but when i perform the following code


            var InputFileWithInteractiveForms = "C:\\Users\\Abhishek.Shrestha\\Downloads\\Template\\form-ub04.pdf";
            var finaldPDFName = "C:\\Users\\Abhishek.Shrestha\\Downloads\\TestABCPDF\\output2322.pdf";
            List<byte[]> filledupForms = new List<byte[]>();
            PdfFormatProvider provider = new PdfFormatProvider();
                
                RadFixedDocument document = provider.Import(File.ReadAllBytes(InputFileWithInteractiveForms));

                var formfields = document.AcroForm.FormFields;

                var formFieldsCopy = new List<FormField>(document.AcroForm.FormFields);

                // Iterate over the copied form fields and replace the dot character in their names for solving merging issue
                foreach (var field in formFieldsCopy)
                {
                    field.Name = field.Name.Replace(".", "");
                }
                
               //added this as the values were being hidden by editable fields
                document.AcroForm.ViewersShouldRecalculateWidgetAppearances = true;

                filledupForms.Add(provider.Export(document));
                File.WriteAllBytes(finaldPDFName, provider.Export(document));

I get the following output:


               
1 comment
ADMIN
Peshito
Posted on: 25 Jul 2023 13:49

Hello Abhi, 

Thank you for providing the problematic document. I was able to reproduce the issue. Indeed this seems like an issue and I converted this thread to a bug report. As gratitude, your Telerik points are now updated. I am afraid I cannot provide a workaround at this point. Please subscribe to the item to get notified of any status updates.

Regards,
Peshito