We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Textbox formatting issues

Hi,

I’m using Aspose.Pdf for .Net v21.6.0 to insert numbers into textboxes and I’m struggling to get a correct format. Could you please take a look?

Using the following code, I’m inserting the values into FormatExamples.pdf and saving the result to Output.pdf. Both attached. Also attached is the result of manual insertion of the same values in Adobe Reader (ManualOutput.pdf).

var document = new Document("D:/FormatExamples.pdf");
foreach (TextBoxField form in document.Form)
{
    form.Value = "-2222.33333";
}
document.Save("D:/Output.pdf");

I can see the following issues:

  1. NumberField1 has an incorrect order of the currency symbol and the minus sign. The result is “€ -2,222.33” while “-€ 2,222.33” is expected.
  2. NumberField2 lost most of the formatting. The negative value is supposed to be in parentheses but it has a minus sign instead. The decimal separator should be “,” but is “.”. And the thousand separator is missing ("." expected). The weird thing is that when I change it to additionally color negative values red, all formatting features are applied.
  3. PercentField1 is expected to have a thousand separator (",") but it’s not there.

Any manual change to a field results in correct formatting. So the formatting is still in there somewhere, it just seems not to be applied.

Thanks,
Michał

FormatExamples.pdf (68.2 KB)
ManualOutput.pdf (69.3 KB)
Output.pdf (67.6 KB)

@acturisaspose

I have been able to reproduce the issue on our end. A ticket with ID PDFNET-50163 has been created in our issue tracking system to further investigate the issue on our end. This thread has been linked with the issue so that you may be notified once the issue will be fixed.