Hello
We are using Aspose.PDF for .NET (22.10.0) to set the appearance of PDF form text boxes.
When there are multiple text boxes with the same name the appearance can be set but when opening the pdf with a viewer only one text box changed appearance.
This is the code I am using to set the fields style:
var doc = new Document(@"c:\temp\form.pdf");
foreach (var widget in doc.Form)
{
widget.DefaultAppearance = new DefaultAppearance("Courier", 12, System.Drawing.Color.Red);
var field = widget as Field;
field.Value = "value";
}
doc.Save(@"c:\temp\out.pdf");
Is there a setting I am missing?
An example input and output form are in attachment.
The text boxes on the left have the same name. The text boxes on the right have different names.
form.pdf (4.3 KB)
out.pdf (6.0 KB)
@markus.estermann
An issue as PDFNET-52938 has been logged in our issue tracking system for the sake of further investigation. We will look into its details and keep you posted with the status of ticket resolution. Please be patient and spare us some time.
We are sorry for the inconvenience.
@markus.estermann
The issue is under the phase of the investigation at the moment. We are afraid that it could not get resolved due to other issues in the queue. Nevertheless, we will surely inform you once we make some updates in this regard. We apologize for the inconvenience.
1 Like
@markus.estermann
“When there are multiple text boxes with the same name”
There are actually three TextBoxFields in the document. One of them (named test_0) has two child elements, input rects.
There is no direct access to child elements from the API - for them, changes will be set according to the change in Default Appearance in the main/parent field.
The corresponding changes to the code have been made and will be used starting from library version 23.10
So, specifying Default Appearance (or Value) results in a change for both display areas.
The issues you have found earlier (filed as PDFNET-52938) have been fixed in this update.