Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Wed Sep 02, 2015 8:32 pm

Hi,

I am working with an existing PDF that has 3 instances of a text field, "signDate". When I examine the PdfTextBoxFieldWidget for this field, it has 3 WidgetItems, which I am guessing somehow represent the 3 instances.

I want to set the ForeColor and Font for all instances. When I do this:

Dim fld As Spire.Pdf.Widget.PdfTextBoxFieldWidget = [this is set to my field]
fld.ForeColor = New PdfRGBColor(0, 0, 255)

it works fine for the FIRST instance of the field on the resulting PDF. How do I set the forecolor for the other instances? The WidgetItems do not have the ForeColor property.

Same question with the Font property.

In summary, I really do not understand the organization/representation of PDF fields with multiple instances. And I could not find any documentation on this topic.

Thank you!

[email protected]
 
Posts: 4
Joined: Mon Aug 10, 2015 5:27 pm

Thu Sep 03, 2015 8:46 am

Hello,

Thanks for your inquiry.
1) I have tested your issue with Spire.PDF Pack Version:3.5 , it worked well in our side. Please download it and have a try. If the issue is still exist, please offer us your sample pdf document. It would be helpful to replicate the issue and work out the solution for you ASAP.
If the information is confidential, you can send it to us ( [email protected] ) via email.
2) You can set the font through the below code.
Code: Select all
 fld.Font = new PdfFont(PdfFontFamily.TimesRoman, 15);


Best Regards,
Sweety
E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Thu Sep 03, 2015 1:53 pm

Hi,

I'm sorry, I did not make my question clear. I do not have a problem setting the font, or forecolor, of a field. What I need to do is set those for each instance of the field.

For example, on my PDF, there is a field "signDate" that occurs three times. When I open the PDF in Acrobat, they appear in the Fields list as signDate#0, signDate#1, and signDate#2. But when I set the font of the field using the line of code you gave as an example, only the first of these, signDate#0, actually is set. My question is, how can I set the font for signDate#1 and signDate#2 also?

I attempted to loop through the field widgets items, as below, but there is no font property for the widget item.

Code: Select all
' There are 3 instances of field "signDate" on the PDF.
' The WidgetItems.count property for that field is 3.
If fld.Name = "signDate" Then
    fld.Font = New PdfFont(PdfFontFamily.TimesRoman, 15)
    For i As Integer = 0 To fld.WidgetItems.Count - 1
        fld.WidgetItems(i).Font =..[No such property]..
    Next
End If


I hope that makes my question clearer.

Thank you.

[email protected]
 
Posts: 4
Joined: Mon Aug 10, 2015 5:27 pm

Fri Sep 04, 2015 9:05 am

Hello,

Could you please provide us your PDF document here, or you can send it to us([email protected]) via email ? We will investigate this issue and then update to you.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Fri Sep 04, 2015 2:45 pm

I will send an example by email, with the title of this topic referenced.

Thank you

[email protected]
 
Posts: 4
Joined: Mon Aug 10, 2015 5:27 pm

Mon Sep 07, 2015 7:34 am

Hello,

Sorry for late reply as weekend.
I have noticed your issue. And I have posted the issue to our dev team. We will inform you when it is fixed. Sorry for the inconvenience.

Best Regards,
Sweety
E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Return to Spire.PDF