I'm trying to add a TextField (acrofield) in the middle of a Paragraph sentence using iTextSharp. An example would be "The Effective Date is [Day] day of [Month], [Year] that this will begin."
Things I have tried:
Paragraph para1 = new Paragraph();
para1.Add(New Phrase("The Effective Date is",fontBold));
//The next line is where it breaks, "Insertion of illegal Element: 30"
para1.Add(CreateTextField("Day",1,0)); //this function returns a PdfPCell.
PdfPCell tempCell = new PdfPCell();
tempCell.AddElement(new Phrase("The Effective Date is",fontBold));
//the next line breaks as well, "Element not allowed."
tempCell.AddElement(CreateTextField("Day",1,0));
Paragraph para1 = new Paragraph();
para1.Add(New Phrase("The Effective Date is",fontBold));
para1.AddSpecial(CreateTextField("Day",1,0));
//This doesn't generate an error, but the TextField is not displayed on PDF
Paragraph para1 = new Paragraph();
PdfPTable tempTable = new PdfPTable(1);
para1.Add(New Phrase("Hello",fontBold));
tempTable.AddCell(CreateTextField("Day",1,0));
para1.Add(tempTable);
para1.Add(New Phrase("World",fontBold));
//This doesn't generate an error, but the TextField is not displayed on PDF
I know the CreateTextField(...) works because I am using it in several other places on the page.
How can I add a TextField inline with other text without using tables and tediously trying to manipulate cell size to accommodate what I need?
Thanks for the help!
See Question&Answers more detail:os