views:

35

answers:

2

Hey All,

I have a situation where I need to copy all of the form fields from one PDF to another. The purpose is to automate the overlaying of the fields when small edits are made to the underlying Word pages.

I've been using the trial version of Aspose.Pdf.Kit, and I'm able to copy everything but Radio buttons to a new form. However Aspose doesn't support copying the radio buttons, which completely nullifies it's usefulness, not to mention their customer support has been subpar.

In any event, I'm looking for some sort of library or plug-in that does support copying all types of form fields.

Does anyone have any ideas?

Thanks,

~DJ

A: 

I agree with Oded, iTextSharp should be able to do the job. I've used code similar the following snippet and never had problems with any field types. I'm sure there must have been a radio button in the mix.

private void CopyFields(PdfStamper targetFile, PdfReader sourceFile){
{
  foreach (DictionaryEntry de in targetFile.AcroFields.Fields)
  {
    string fieldName = de.Key.ToString();
    target.AcroFields.SetField(fieldName, sourceFile.AcroFields.GetField(fieldName));
  }
}
madisonw
The SetField function only sets the value of the field, it doesn't actually add a new field object to the pdf file.
DJ Quimby