We have a PDF file designed using Adobe LiveCycle. There are certain fields marked as Plain Text and Rich Text. For fields marked as Rich Text, we need to display Rich Text Editor to users in the html page.
1. There are two fields ‘SPFreeText1’ & ‘SPFreeText2’ marked as Rich Text. However, when checking in code it is returning totally different flags.
a. For SPFreeText1, it is showing RadiosInUnision Flag
b. For SPFreeText2, it is showing a number which is not the number of RichText flag.
2. Cannot access Font, Fontsize properties for PdfFomField Class. We are using ceTe.DynamicPDF.10.dll
Here is my code:
Dim myPDFDoc As PdfDocument = New PdfDocument("C:\A5 Team Bingo.pdf")
Dim mergeDoc As MergeDocument = New MergeDocument(myPDFDoc, MergeOptions.All)
For Each field As FormField In mergeDoc.Form.GetTextFields()
field.IsReadOnly = True
If field.Name.Contains("SPFreeText") Then
Dim pdfField As PdfFormField = myPDFDoc.Form.Fields(field.FullName)
' UNABLE TO ACCESS FONT AND FONTSIZE PROPERTIES OF PdfFormField
Dim style As FormattedTextAreaStyle = New FormattedTextAreaStyle(FontFamily.Helvetica, 12, True)
Dim page As Page = mergeDoc.Pages(pdfField.GetOriginalPageNumber() - 1)
Dim formattedTA As FormattedTextArea = New FormattedTextArea(" Test <b><u>This</u></b>", pdfField.GetX(page), pdfField.GetY(page), pdfField.Width, pdfField.Height, style)
page.Elements.Add(formattedTA)
' RICHTEXT FLAG NOT RECOGNISED. INSTEAD DISPLAYING RadiosInUnision AND SOME NUMBER
MsgBox(field.Flags.ToString())
End If
Next
mergeDoc.DrawToWeb(False)
Can you please let me know if I am doing something wrong here?