Hey,
When I programmatically modify the pdf textbox field values, some characters don't show.
But when I clicked on that textbox, its shows all of the character.
I need to get those characters without clicking on textbox. Any help?
I'm using the latest spire pdf - v7.7.10 | .Net Framework | C# in my project.
Here I attached pdf input & output files.
Two images of output files: 1) Before click on text field. 2) After click on text field
code sample:
static void Main(string[] args)
{
var inputlocation = @"C:\Code\ZTestApp\ConsoleApp\spire\input.pdf";
var outputlocation = @"C:\Code\ZTestApp\ConsoleApp\spire\output.pdf";
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(inputlocation);
PdfFormWidget formWidget = doc.Form as PdfFormWidget;
if (formWidget != null)
{
for (int i = 0; i < formWidget.FieldsWidget.List.Count; i++)
{
PdfField field = formWidget.FieldsWidget.List[i] as PdfField;
if (field is PdfTextBoxFieldWidget)
{
PdfTextBoxFieldWidget textBoxField = field as PdfTextBoxFieldWidget;
textBoxField.Text = textBoxField.Text;
}
}
}
doc.SaveToFile(outputlocation);
}