Dear ryan,
From your code, I learned your requirement, but you misunderstood the usage of the method. As a new method, FormEditor.CopyOuterField() lacks of detailed API instruction.
1) With CopyOuterField(String srcFileName, String fieldName), a field will be copied from the original page & position to the same page & position in the output document.
2) With CopyOuterField(String srcFileName, String fieldName, int pageNum), a field will be copied from the original page & position to another page with the same position in the output document.
3) With CopyOuterField(String srcFileName, String fieldName, int pageNum, float abscissa, float ordinate), a field will be copied from the original page & position to the output document with specified page number and position.
So you needn't split original document to obtain each field's page number. I changed your button1_Click( ) functional coldes into the following lines:
FormEditor formEditor = new FormEditor(copyToPdfOrriginal , copyToPdfWorking );
Aspose.Pdf.Kit.Form pdfForm = new Aspose.Pdf.Kit.Form(copyFromPdf );
foreach (string fieldName in pdfForm.FieldsNames)
{
if (pdfForm.GetFieldType(fieldName) != FieldType.Radio)
{
formEditor.CopyOuterField(copyFromPdf , fieldName);
}
}
pdfForm.Save();
formEditor.Save();
I ran the example and get the required output, except that some check boxes are automatically selected. This will be fixed soon, and it will be included in the next release version, together with the support for radio button. Please try again and feel free to contact us when you still have problems.
Best regards.
Luke Fu
Product Developer
Aspose Changsha Team
About Us Contact Us