All I want to do is add some form fields and set their font, color, and alignment properties but I’m unable to do it no matter what I try. Here’s the code I’m using to (1) add a field, (2) set the attributes, and (3) save the pdf.
// Add a new field
formEditor.AddField(FieldType.Text, "
MyFieldName", “123,345”, 1, (float)aRect.LLX, (float)aRect.LLY, (float)aRect.URX, (float)aRect.URY);
// Set the field properties
FormFieldFacade fieldFacade = new FormFieldFacade();
formEditor.Facade = fieldFacade;
fieldFacade.Font = Aspose.Pdf.Facades.FontStyle.TimesRoman;
fieldFacade.FontSize = 8;
fieldFacade.Alignment = FormFieldFacade.AlignRight;
fieldFacade.BackgroundColor = System.Drawing.Color.Yellow;
formEditor.DecorateField(“MyFieldName”);
// Save it
formEditor.Save();
The field appear where I want it to and the alignment and background properties behave correctly but it doesn’t matter what I set the Font and FontSize to. The font always remains as Helvetica with 12 point font size.
PLEASE HELP!
Hi Mike,
Thank you for sharing the sample code.
I am able to reproduce the mentioned issue after an initial test with the latest version of Aspose.Pdf for .NET. Your issue has been registered in our issue tracking system with issue ID: PDFNEWNET-33172.
We will notify you via this forum thread regarding any update against your reported issue.
Sorry for the inconvenience.
The issues you have found earlier (filed as PDFNEWNET-33172) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.