Hello!
We are trying to fill an interactive PDF (that only has one interactive textfield) with a certain code that needs to be white, a specific font size and also bold. I've tried to make a new PDF font according to your example ("Set the font and color for the text on PDF Combo Box field area").
Here is my code:
For i As Integer = 0 To elementList.Count - 1
If TypeOf elementList(i) Is PdfTextBoxFieldWidget Then
Dim textBoxField As PdfTextBoxFieldWidget = TryCast(elementList(i), PdfTextBoxFieldWidget)
Select Case textBoxField.Name
Case "KUPONG"
Dim newFont = New PdfTrueTypeFont(New Font("Arial", 20.0F, FontStyle.Bold))
textBoxField.Text = voucherKod
textBoxField.TextAlignment = PdfTextAlignment.Center
textBoxField.ForeColor = Color.White
textBoxField.Font = newFont
End Select
End If
Next
As you can see, there's only one field we're looking for in the PDF ("KUPONG"). I picked the font "Arial", 20.0F and set the fontstyle to bold. The problem is, that in some pages, the code is bolded, and in some, it isn't. We can't see any pattern either (like every other or something like that). Are we doing something strange?
Also see the images that I've added. They show how the result looks like (some PDF's are getting the bolded text and some aren't).
Best regards,
Elin