Welcome Guest Search | Active Topics | Sign In | Register

Setting Foregroundcolor of AcmTextBox when printing Options
Ola Westerholm
Posted: Wednesday, April 27, 2022 8:07:49 AM
Rank: Newbie
Groups: Member

Joined: 6/12/2014
Posts: 3
Hi EO Team!

I am creating a PDF document with some interactive text boxes (AcmTextBox). I am trying to set the foreground color of the ActTextBoxes to Blue. It works, if set the Value of the textbox, before I render it, then the text will be blue. But if I edit/change the text, it becomes black. When I leave the textbox, the text becomes more gray. If I print the PDF the text becomes black.

Is it possible to change the color of the text to become blue when I print the PDF document?

Here is my code:

EO.Pdf.Acm.AcmTextBox textbox = new EO.Pdf.Acm.AcmTextBox();
textbox.Style.Width = 2.0f;
textbox.Style.Height = 0.16f;
textbox.Name = classname;
textbox.Style.FontName = "Source Sans Pro";
textbox.Style.FontSize = 8f;
textbox.Style.FontStyle = FontStyle.Regular;
textbox.Style.ForegroundColor = Color.Blue;
if (!string.IsNullOrEmpty(text))
textbox.Value = text;
block.Children.Add(textbox);

Best Regards,
Ola
eo_support
Posted: Wednesday, April 27, 2022 5:18:29 PM
Rank: Administration
Groups: Administration

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

This is not supported in the current build. However it will be automatically supported in our next build. There will be no code changes required on your end.

We will reply here again as soon as the new build is available.

Thanks!
eo_support
Posted: Monday, May 9, 2022 3:24:34 PM
Rank: Administration
Groups: Administration

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

This is just to let you know that we have posted a new build that should resolve this issue. You can download the new build from our download page. Please take a look and let us know how it goes.

Thanks!
Ola Westerholm
Posted: Tuesday, May 10, 2022 4:18:49 AM
Rank: Newbie
Groups: Member

Joined: 6/12/2014
Posts: 3
Hello!

I have tried the new build, but I am getting some weird result. I have three AcmTextBoxes in my PDF. If I don't set the Value property of any of them, I can't see the text that I am trying to input, it seems to be transparent. If I set the Value property of one of the AcmTextBoxes, to "Test". Then the Test shows in Blue. If I input Test in any of the other two textboxes, it also works. But if I input something else, for example "Hello", then it shows some other characters together with spaces. Although, if I copy these characters with ctrl-c, and paste them to notepad, it show "Hello". I get a similar behavior when I try the interactiv sample that yoy provide.

Best Regards,
Ola
eo_support
Posted: Tuesday, May 10, 2022 10:36:02 AM
Rank: Administration
Groups: Administration

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

Can you send a small test project to us along with the font you use? Please see here for more information about how to send test project to us:

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

Once we have the test project we will debug into it here and see what we can find.

Thanks!
eo_support
Posted: Wednesday, May 11, 2022 2:10:47 PM
Rank: Administration
Groups: Administration

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

We have received your test project. We are able to reproduce the issue you described in Google Chrome. However we were not able to reproduce it in Adobe Reader. Can you check if it works with Adobe Reader on your side?

In the mean time we are looking into the Google Chrome case and hopefully we can get that to work.

Thanks!
eo_support
Posted: Wednesday, May 11, 2022 4:24:14 PM
Rank: Administration
Groups: Administration

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

Please try to set your textbox's Style.FontName to one of the following values:

Code:
Courier
Helvetica
Times-Roman


For example:

Code: C#
textbox.Style.FontName = "Helvetica";


A few additional variations of the above fonts (for example, "Courier-Bold") can also be used but are not encouraged.

This should resolve the issue for you. These are special fonts that all PDF Readers are required to know how to render without the corresponding font data being embedded inside the PDF file. The issue you are seeing is caused by font data for new character (for example, when user enters "d" into a textbox that initially only had "abc") was not already embedded in the PDF file. To support allowing any character for another font, it would require the entire font data to be embedded. This can significiantly increase the PDF file size as modern font (such as Arial) contains thousands of characters.

Thanks!
Ola Westerholm
Posted: Thursday, May 12, 2022 3:50:22 AM
Rank: Newbie
Groups: Member

Joined: 6/12/2014
Posts: 3
Hi,

Now it works, using the fonts you suggested. Thanks a lot!

Best Regards,
Ola
eo_support
Posted: Thursday, May 12, 2022 10:38:07 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Great. Glad to hear that it works for you!


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.