Sign UpSign Up   Sign InSign In Welcome Guest,
Live Chat Live Chat

PDF Merge multiple fields with same name

Last post 07-05-2009, 4:02 AM by aspose.notifier. 25 replies.
Page 1 of 2 (26 items)   1 2 Next >
Sort Posts: Previous Next
  •  02-09-2009, 7:16 PM 164254

    PDF Merge multiple fields with same name

    Attachment: Present (inaccessible)
    Hello - I am using PDF.Kit.Form to merge my data with form fields in a PDF.  In some cases the PDF contains multiple fields with the same field name.  When I merge a PDF with 2 or more fields with the same name, only one of the duplicate named field gets populated with data.

    I checked the XML source of the PDF and it is only the first field occurance that gets populated. I verified this by swapping the XML of two fields with duplicate names and the first field always gets populated while the second does not. All other fields that do not have duplicates receive the data OK.

    I have tried doing this merge with Form.ImportXml() as well as Form.Fill(). The same result happens with both methods. I was using PDF.Kit v 2.7.0.0. I tried using the latest v.3.3.0.0 and the issue still remains.

    I have attached a sample PDF that demonstrates this issue. Please look for the two "LastName" fields. Thanks in advance for your help.
     
  •  02-09-2009, 8:06 PM 164258 in reply to 164254

    Re: PDF Merge multiple fields with same name

    Update: As an alternative to the Form class I tried the AutoFiller class (ImportDataTable function) and the same issue happens with this method as well.
     
  •  02-09-2009, 9:25 PM 164263 in reply to 164258

    Re: PDF Merge multiple fields with same name

    Hi,

    Thank you very much for considering Aspose.

    We're looking into the matter and will update you the earliest possible.

    We appreciate your patience.

    Regards,

     


    Shahzad Latif - [Follow me on Twitter!]
    Support Developer/Developer Evangelist
    Aspose Sialkot Team
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  02-11-2009, 3:31 AM 164574 in reply to 164263

    Re: PDF Merge multiple fields with same name

    Hi,

    We have investigated the issue at our end and realized that two fields with the same name can't be added in a pdf file. Can you please elaborate the issue in a bit more detail? Also, if you could share related xml files as well, that'll help us understand and resolve the issue.

    Regards,

     


    Shahzad Latif - [Follow me on Twitter!]
    Support Developer/Developer Evangelist
    Aspose Sialkot Team
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  02-11-2009, 11:24 AM 164697 in reply to 164574

    Re: PDF Merge multiple fields with same name

    From my experience Adobe does not complain when saving two field names with the same name.  If you please take a look at the PDF document i attached in my first post you can see that there are two fields with the same field name "LastName". Can you confirm this?
     
  •  02-11-2009, 11:48 AM 164706 in reply to 164697

    Re: PDF Merge multiple fields with same name

    Attachment: Present (inaccessible)
    I forgot to attach the XML in the first post. You can find it attached here. Please notice the two "LastName" fields at the top of the document. This matches the PDF i attached in the first post. Thank you for your help
     
  •  02-11-2009, 4:15 PM 164765 in reply to 164706

    Re: PDF Merge multiple fields with same name

    Hi,

    Thanks for sharing the resource files. We are looking into the details of this problem and will reply to you soon.


    Nayyer Shahbaz
    Support Developer, Aspose Sialkot Team
    About Us
    Contact Us

    Keep in touch! We're on Twitter and Facebook
     
  •  02-12-2009, 12:41 AM 164807 in reply to 164706

    Re: PDF Merge multiple fields with same name

    Hi,

    I've tested the scenario and have noticed that, "multi-test.pdf" does not get populated when using Form.ImportXml() method. I've tried importing the data contents of "multi-test.xml" that you have shared, but no success. I've used the following code snippet.

    [C#]
    //Assign input and output PDF documents
    Aspose.Pdf.Kit.Form form = new Aspose.Pdf.Kit.Form(@"c:\Temp\multi-test.pdf", @"c:\Temp\multi-test_filled.pdf");
    //Create an XML file as a FileStream that contains the contents of the PDF document|
    System.IO.FileStream xmlInputStream = new FileStream(@"c:\Temp\multi-test.xml", FileMode.Open);
    //Import the values from the XML file to the PDF form
    form.ImportXml(xmlInputStream);
    //Save the output PDF document
    form.Save();
    //Close the input XML stream
    xmlInputStream.Close();

    It would be more appropriate, if you could share the code snippet that you are using. During my investigation, I've found that, the two occurrences of LastName field, are present as LastName[0] and LastName[1]. When you simply call the method Form.Fillfield("LastName","Mike"), it searches for the field named as "LastName" and fills in the information for the first instance which is LastName[0]. But, if you try using the following code snippet, you would notice that, both the field occurrences get filled.

    [C#]
    //Instantiating Aspose.Pdf.Kit.Form object giving input and output PDF files as input
    Aspose.Pdf.Kit.Form form = new Aspose.Pdf.Kit.Form(@"c:\Temp\multi-test.pdf", @"c:\Temp\multi-test_filled.pdf");
    //Filling a Text Field (Name)
    form.FillField("LastName[1]", "Mike");
    form.FillField("LastName[0]", "Mike");
    //Save the output PDF document
    form.Save();

    The exact full name of the field can be something like topmostSubform[0].Page1[0].LastName[0] or topmostSubform[0].Page1[0].LastName[1]. Please visit the following link for information on Identifying form fields names

     

    If it does not satisfy your query, please feel free to contact.


    Nayyer Shahbaz
    Support Developer, Aspose Sialkot Team
    About Us
    Contact Us

    Keep in touch! We're on Twitter and Facebook
     
  •  02-13-2009, 1:17 PM 165199 in reply to 164807

    Re: PDF Merge multiple fields with same name

    Attachment: Present (inaccessible)
    Hi Nayyer,

    Thank you for your detailed response and help with this problem. After reading your response I must clarify a few things. First of all the XML i sent you is not the XML i am using to load the PDF Form object. I copied that XML out of the XML view in Adobe LiveCycle Designer. I am loading the PDF Form object from the actual PDF file, not from Form.ImportXML() as you suggested. I have no problems opening the PDF using the PDF file that is attached in my first post. With that said, I now have a second issue with another PDF. I will clarify both remaining issues below:

    Issue #1 (from above)
    From your response I now understand that we are using the term "Field Name" differently. When you say FieldName you are referring to the full field name in Form.FieldsNames - i.e. "topmostSubform[0].Page5[0].LastName[0]". When I was referring to field name i meant the "short" field name like you would see in Adobe - i.e. "LastName". I would like to fill all fields named "LastName" with a value regardless of what form or page they are on and regardless if there are multiple fields with that name on the same page and form. I want all of them filled with the same value. I would like to be able to run Form.FillField("LastName", "test"); and have all instances of that field filled. Is this possible or is this not possible?

    Issue #2 (new)
    Now I am having a new, but related, issue with another PDF. Please see the PDF attached to this post. This PDF contains three LastName fields. I am trying to fill each field with the full field name. Please consider the code below.

    pdf.FillField("topmostSubform[0].Page5[0].LastName[0]", "test");
    pdf.FillField("topmostSubform[0].Page6[0].LastName[1]", "test");
    pdf.FillField("topmostSubform[0].Page6[0].LastName[0]", "test");


    If you use the above code with the attached PDF only the first two "LastName" fields get filled. In order to futher debug this issue I tried commenting out all but one of these three lines - in other words filling only one of them. If i run that first line of code by itself, it fills the first field as expected. If i run the second line by itself it fills the second field as expected. If i run the third line by itself it fills the first field instead of the expected third field. As you can see they have completely different full field names specified yet the wrong field is getting filled. Please let me know if you can reproduce this behavior with this PDF.

    Thank you for your help.

     
  •  02-13-2009, 5:11 PM 165216 in reply to 165199

    Re: PDF Merge multiple fields with same name

    Hi,

    Please spare us little time, as we are looking into the details of this problem and will reply to you soon.


    Nayyer Shahbaz
    Support Developer, Aspose Sialkot Team
    About Us
    Contact Us

    Keep in touch! We're on Twitter and Facebook
     
  •  02-14-2009, 2:43 AM 165234 in reply to 165216

    Re: PDF Merge multiple fields with same name

    Dear Ruiz ,

    Thanks for considering Aspose.Pdf.Kit.

    This problem has been reproduced at our platform. It has been recorded into our bug tracing system. We are working hard to solve this problem, the ETA is about 3 weeks. Thanks for your patience.

    Best regards.


    Luke Fu
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  02-17-2009, 1:17 PM 165653 in reply to 165234

    Re: PDF Merge multiple fields with same name

    Luke, thank you for the update. I look forward to hearing the results.
     
  •  03-03-2009, 12:20 PM 167924 in reply to 165653

    Re: PDF Merge multiple fields with same name

    Hi Luke, is there any news on this issue?
     
  •  03-03-2009, 1:34 PM 167937 in reply to 167924

    Re: PDF Merge multiple fields with same name

    Dear Ruiz ,

    Thanks for your patience. This issue is ongoing as we planned before. The reason has been found and we are studying how to solve it. The fixed is expected to be included in the next release. Once finished it, I will inform you here.

    Best regards.


    Luke Fu
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  03-22-2009, 12:39 PM 170880 in reply to 167937

    Re: PDF Merge multiple fields with same name

    Dear Ruiz,

    Sorry for the late notification. This issue has been solved and after careful testing, the hotfix will be included in the next release. Please notice our blog for the information.

    Best regards.


    Luke Fu
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
Page 1 of 2 (26 items)   1 2 Next >
View as RSS news feed in XML