Welcome Guest Search | Active Topics | Sign In | Register

Form Field loses formatting when setting value via PdfTextField Options
J. Orlando
Posted: Friday, June 17, 2022 11:42:41 AM
Rank: Newbie
Groups: Member

Joined: 6/17/2022
Posts: 2
Hello,
I'm struggling with a seemingly simple issue. I have a business requirement where I need to set up a PDF with various form Text Fields that are of different colors, background colors, border colors, fonts and orientations. I set this up using FoxIt PhantomPDF and things work great when I fill it out any PDF reader.

However, when I dynamically fill this out using EO.PDF, the form fields have no formatting, but when I manually type into the field and add a character and then click off the field, my formatting applies including font, foreground color, background color, border and orientation.

My code looks something like this:
Code: C#
using (Stream inputStream = new MemoryStream(inputByteArray))
            {
                PdfDocument document = new PdfDocument(inputStream);

                PdfTextField fieldSSN = document.Fields["SSN"] as PdfTextField;
                fieldSSN.IsAppearanceInherited = true;
                fieldSSN.Text = "111-11-1111";

                using (MemoryStream outputStream = new MemoryStream())
                {
                    document.Save(outputStream);
                    outputByteArray = outputStream.ToArray();
                }
            }


I feel like I've tried just about everything.
We have the license for version 19.2.91, and I even tried temporarily upgrading to 22.1.42 with the same results.

Any help would be much appreciated as there is a rapidly approaching deadline and I need to decide soon if I'm going to use this technology or go a different route.

Thanks,
eo_support
Posted: Friday, June 17, 2022 3:43:11 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
This appears to be an issue on our side. Can you send us the PDF file in question so that we can take a look here? See here for more information on how to send test file to us:

https://www.essentialobjects.com/forum/test_project.aspx

Thanks!
eo_support
Posted: Friday, June 24, 2022 3:28:59 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

We have posted a new build that should support this now. Please see your private message for the download location.

Thanks!
J. Orlando
Posted: Monday, June 27, 2022 10:09:28 AM
Rank: Newbie
Groups: Member

Joined: 6/17/2022
Posts: 2
Thanks very much for the prompt turnaround!
eo_support
Posted: Monday, June 27, 2022 3:24:30 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Great. Thanks for confirming the fix!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.