Copy form fields from one PDF to another

Last post 03-28-2009, 3:17 AM by forever. 23 replies.
Page 2 of 2 (24 items)   < Previous 1 2
Sort Posts: Previous Next
  •  02-16-2009, 2:58 PM 165432 in reply to 164811

    Re: Copy form fields from one PDF to another

    Attachment: Present (inaccessible)

    I tried the new CopyOuterField method on one of our pdf files.  It seemed to copy the fields, but I was unable to type in the textboxes.  Also when I would go to edit the form in Adobe Acrobat Professional and go to the properties of one of the textboxes Acrobat would crash.  I have included a sample project and the PDF files I was working with so you can test it.

    Thanks,
    Ryan

     
  •  02-16-2009, 10:28 PM 165478 in reply to 165432

    Re: Copy form fields from one PDF to another

    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
     
  •  02-17-2009, 11:32 AM 165633 in reply to 165478

    Re: Copy form fields from one PDF to another

    Thank you for sending the updated code.  I ran the new code and I was able to type in the text fields this time.  I did some further testing and I ran into another situation that does not appear to work based on the code you sent me.  Basically we have some PDF forms that have a form field with the same name on it multiple times.  The situation is our forms may ask for a person's home address or some other piece of information multiple time on multiple pages of the document.  If the form fields are the same name then when they fill out one field it will automatically populate the other fields of the same name throughout the document.  I noticed in your sample that when I call CopyOuterField(String srcFileName, String fieldName) that it only copies the first form field of the matching name in the document.  I had noticed this limitation before and this is why I was splitting the pages of the PDF document.  I don't think we would ever put a form field of the same name twice on the same page.  Would it be possible for you to make the CopyOuterField(String srcFileName, String fieldName) find all instances of a form field with the matching name and copy it to the corrisponding pages?

    Thanks,
    Ryan

     
  •  02-18-2009, 3:27 AM 165752 in reply to 165633

    Re: Copy form fields from one PDF to another

    Dear ryan,

    As you known, a field can only have one unique field name in a common document . Frankly, your requirement can't be satisfied with the current CopyOuterField() methods. However, we are still considering to support this feature.  In order to support duplicated field name, we have to cost more time, maybe another week. If possible, please share your PDF forms (with duplicated fields) to accelerate our developing, thanks :)

    Best regards.


    Luke Fu
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  02-18-2009, 11:20 AM 165837 in reply to 165752

    Re: Copy form fields from one PDF to another

    Attachment: Present (inaccessible)

    I have attached a form that is a good example of multiple form fields with the same name.  The form field cltName and AdvisorName are found multiple times in the document and cltName appears twice on page 2 of the document.  I am not sure of all of the rules that go into form fields but the one thing I do know that that we often see form field names duplicated when we look at account forms from our various vendors.  Also when drawing form fields in Adobe Acrobat Professional there doesn't seem to be any indication that this is something that should not be done.

    Thank you for considering this feature as I think it will be a welcome feature by many developers.

    Ryan

     
  •  02-18-2009, 6:14 PM 165903 in reply to 165837

    Re: Copy form fields from one PDF to another

    Dear Ryan,

    Thanks for your help. This will help us to solve it ASAP. Once finished, I will inform you at this thread.

    Best regards.


    Luke Fu
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  02-25-2009, 5:41 PM 166999 in reply to 165903

    Re: Copy form fields from one PDF to another

    Dear Ryan,

    I am glad to inform you that the supporting for radio button is finished. As for your second requirement, actually it is not an easy job, and it will be costed another week.  I will inform you here, thanks for your patience.

    Best regards.


    Luke Fu
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  03-15-2009, 4:42 AM 169757 in reply to 166999

    Re: Copy form fields from one PDF to another

    Dear Ryan,

    Sorry for the late reply. Supporting for radio button field is completed. However, we found some difficult  with the sharp of radio border. Presently, we can only support radio box with single type of border, either circle or rectangle.  Is it acceptable for you? Hope for your advice.

    Best regards.


    Luke Fu
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  03-28-2009, 3:17 AM 172087 in reply to 157266

    Re: Copy form fields from one PDF to another

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


    This message was posted using Notification2Forum from Downloads module by forever.
     
Page 2 of 2 (24 items)   < Previous 1 2
View as RSS news feed in XML