Free Support Forum -

Can't assign string to some kind of fields

Hi Aspose,

The Document.pdf (30.1 KB)
contains form fields. When try to set value of field “Date” (field.Value = “”) - Aspose crashes with error “Value of ‘65025’ is not valid for ‘red’. ‘red’ should be greater than or equal to 0 and less than or equal to 255.”
Such error appears when try to set first 4 fields in sample document.

I use Aspose.PDF 18.11

Many thanks,
Alex Shloma


Thank you for contacting support.

We have been able to reproduce the issue with below code snippet in our environment. A ticket with ID PDFNET-45727 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

Document pdfDocument = new Document(dataDir + @"8308481_PDF Demo Document.pdf");
Aspose.Pdf.Forms.Form form = pdfDocument.Form;
var fields = form.Fields;
foreach (Aspose.Pdf.Forms.Field field in fields)
    if (field.PartialName == "Form41559")
        field.Value = "test string";
        //field.Value = DateTime.Now.ToString("MM/dd/yyyy");
pdfDocument.Save(dataDir + "Filled_18.11.pdf");

We are sorry for the inconvenience.