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

Free Support Forum - aspose.com

ArgumentException when combobox selected index is set

Hi,

I am trying to set the state lookup in the attached PDF form (I-9 Form). The relevant Field is “State” in Section 1 of Page 1 of the Form.
Issue 1: I get an ArgumentException (Invalid font name) when I set the Selected property of the lookup. Issue 2: If I put the statement in a Try-Catch block, I can see the state set in the PDF form when opened with Adobe Acrobat Reader XI(version 11.0.06). But I can not see the state field set to the value I wanted when the output PDF form is opened with either Foxit reader (version 6.1.4) or Microsoft Reader App (Windows 8)
Issue 3: When I try to print the output PDF form from Adobe Acrobat, I get the following error: “An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem.

The following code reproduces the Issues:
static void FillForm()
{
var pdfDoc = new Document(@“C:\Scratch\2013_I-9.pdf”);
foreach (Field field in pdfDoc.Form)
{
FindAndSetField(field);
}
pdfDoc.Save(@“C:\Scratch\2013_I-9_Filled.pdf”);
pdfDoc.Dispose();
}

private static void FindAndSetField(Field field)
{
if (field.FullName == “form1[0].#subform[6].State[0]”)
{
var cboField = (ComboBoxField) field;
foreach (var item in cboField.Options.Cast())
{
if (item.Value == “CA”)
{
try
{
cboField.Selected = item.Index;
//Issue 1: Get Argument Exception (Invalid font name).
//Issue 2: Value is visible only with Acrobat Reader. Value not visible with Foxit or Microsoft Reader (Windows 8)
//Issue 3: Error when printing the form from Acrobat Reader
}
catch (ArgumentException)
{}
break;
}
}
}
else if (field.Count > 0)
{
foreach (Field subField in field)
{
FindAndSetField(subField);
}
}
}

I am able to reproduce the issue with the following system setup:
OS: Windows 8.1
IDE: Visual Studio 2012
.Net: 4.0
Aspose.PDF: 7.9.0.0

Attachment Contents:
1. 2013_I-9.pdf: Source PDF file
2. 2013_I-9_Filled.pdf: Output PDF file generated by my program
3. PrintError.jpg: Error Shown by Acrobat when printing the output form
4. Program.cs: My test program that reproduces the issue
5. State Field causing error.jpg: Shows the Field in the PDF form causing the error.

orangeenterprises:
Issue 1: I get an ArgumentException (Invalid font name) when I set the Selected property of the lookup.
Hi Kishore,

Thanks for contacting support.

I have tested the scenario and I am able to
notice the same problem. For the sake of correction, I have logged this problem
as PDFNEWNET-36528 in our issue tracking system.
orangeenterprises:
Issue 2: If I put the statement in a Try-Catch block, I can see the state set in the PDF form when opened with Adobe Acrobat Reader XI(version 11.0.06). But I can not see the state field set to the value I wanted when the output PDF form is opened with either Foxit reader (version 6.1.4) or Microsoft Reader App (Windows 8)
I have managed to reproduce this problem and have separately logged it as PDFNEWNET-36530.
orangeenterprises:
Issue 3: When I try to print the output PDF form from Adobe Acrobat, I get the following error: "An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem."
I have also managed to reproduce this problem and have separately logged it as PDFNEWNET-36529 in our issue tracking system. We will further look into the details of these problems and will keep you updated on the status of correction. Please be
patient and spare us little time. We are sorry for this inconvenience.

Hi,

I can work-around Issues 1 and 2 (PDFNEWNET-36528, PDFNEWNET-36530) with the Try-Catch and having the users use Acrobat-reader. But I either need a fix or a work-around for Issue 3 [PDFNEWNET-36529] (Printing) mentioned above. Please let me know if you have a work-around we can use for our customers.

Thank you.

Hi Kishore,


Thanks for your feedback. We have good news for you PDFNEWNET-36528 and PDFNEWNET-36530 issue ids have been resolved. Fix of these issues will be included in Aspose.Pdf for .NET 9.1.0. Hopefully it will be published in start of April, 2014. However, we will notify you via this forum thread as soon as it is published and gets available for download.

Moreover in reference to printing issue PDFNEWNET-36529, error occurs in a printing attempt without filling the form with Aspose.Pdf. So I am afraid we cannot fix the error message as we try to mimic Adobe Acrobat as closest as possible.

We are sorry for the inconvenience caused.

Best Regards,

Hi,

Thank you for pointing out the error occurs in printing without filling the form for issue PDFNEWNET-36529. It did not occur to us to test that the issue could be in the original PDF form. We recreated that form and printing works now in our program. There could have been a bug introduced when we originally created that PDF form.
Thank you.

Hi Kishore,


Thanks for sharing the details.

As shared earlier, I am afraid we cannot fix the issue PDFNEWNET-36529 and you also managed to resolve it by recreating the form. However concerning to other two issues, the fix will be include in upcoming release of Aspose.Pdf for .NET 9.1.0 which is planned to be published in April-2014. Please be patient and wait for new release.

The issues you have found earlier (filed as PDFNEWNET-36528;PDFNEWNET-36529;PDFNEWNET-36530) have been fixed in Aspose.Pdf for .NET 9.1.0.

For further details, you may check this blog post.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.