Form.FillField throwing System.ArgumentException: Invalid font name

I have some PDFs that when I call

TempForm.FillField("somefield", "value");

it throws the exception

'System.ArgumentException: Invalid font name
at Aspose.Pdf.Text.FontCollection.get_Item(String name)
at Aspose.Pdf.InteractiveFeatures.Forms.TextBoxField.createAppearanceProgram(AppearanceParameters parameters, Annotation annotation)
at Aspose.Pdf.InteractiveFeatures.Annotations.WidgetAnnotation.(Annotation )
at Aspose.Pdf.InteractiveFeatures.Forms.Field.()
at Aspose.Pdf.InteractiveFeatures.Forms.Field.setValue(String value)
at Aspose.Pdf.InteractiveFeatures.Forms.Field.set_Value(String value)
at Aspose.Pdf.InteractiveFeatures.Forms.TextBoxField.set_Value(String value)
at Aspose.Pdf.Facades.Form.FillField(String fieldName, String fieldValue)'System.ArgumentException: Invalid font name
at Aspose.Pdf.Text.FontCollection.get_Item(String name)
at Aspose.Pdf.InteractiveFeatures.Forms.TextBoxField.createAppearanceProgram(AppearanceParameters parameters, Annotation annotation)
at Aspose.Pdf.InteractiveFeatures.Annotations.WidgetAnnotation.(Annotation )
at Aspose.Pdf.InteractiveFeatures.Forms.Field.()
at Aspose.Pdf.InteractiveFeatures.Forms.Field.setValue(String value)
at Aspose.Pdf.InteractiveFeatures.Forms.Field.set_Value(String value)
at Aspose.Pdf.InteractiveFeatures.Forms.TextBoxField.set_Value(String value)
at Aspose.Pdf.Facades.Form.FillField(String fieldName, String fieldValue)

Is that expected if the PDF has embedded fonts?

Hi Jay,

Can you please share the source PDF document so that we can test the scenario at our end. In case there is any font already embedded in PDF, Aspose.Pdf for .NET must not through any exception. Please ensure that you are using the correct field name when filling the data. We are sorry for this inconvenience.

Attached is a PDF that shows the problem. If you try to set any form field on that PDF, the exception is thrown.

Thanks

Hi Jay,

Thanks for sharing the resource file. I have managed to reproduce the same problem and its been logged as PDFNEWNET-31508 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time. We apologize for your inconvenience.

The issues you have found earlier (filed as 31508) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.