Sign In  Sign Up Live-Chat

Preserve the highlighting of text in output file

Last post 03-22-2006, 7:45 AM by lukeyoyo. 5 replies.
Sort Posts: Previous Next
  •  03-20-2006, 11:43 PM 44408

    Preserve the highlighting of text in output file

    Attachment: Present (inaccessible)

    How Can I preserve the formatting of my pdf file after filling up the form fields from a datasource?

    I am using autoFiller method to fill the form fields. But after using AutoFiller.Save method, all the formatting is gone. In my original pdf file, I have highlighted some text with background of Yellow color. But in the outputfile, there is no higlighting.

    Is there any way that I can preserve the highlighting? Please find my original file as attachment.

    Regards,

    Pareena Bawa

     
  •  03-21-2006, 12:49 AM 44416 in reply to 44408

    Re: Preserve the highlighting of text in output file

    Thanks for considering Aspose.

    We will test the file and give u a reply ASAP.


    Kevin Zuo
    Content Supporter
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  03-21-2006, 2:19 AM 44430 in reply to 44408

    Re: Preserve the highlighting of text in output file

    Hi,

    I downloaded your file and found that there are two text fields having the same field name, one in Page 1,  the other in Page 2.

    In my test, all is ok except that the two fields having the same value as what was set latter. I wonder this could be the reason. So please change some other name and try again. Any more question is welcomed.

    Best regards.


    Luke Fu
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  03-21-2006, 2:46 AM 44436 in reply to 44408

    Re: Preserve the highlighting of text in output file

    Hi,

    Thanks for the consideration.

    I tried after removing the fields with same name but the problem persists. The pages on which there are no merge fields, the formatting do remains but not on the pages with merge fields.

    any suggestions?

    Thanks.

     

     
  •  03-21-2006, 8:01 AM 44452 in reply to 44408

    Re: Preserve the highlighting of text in output file

    We've reproduced the problem you said, and it will be solved ASAP.

    Best regards.


    Luke Fu
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  03-22-2006, 7:45 AM 44514 in reply to 44408

    Re: Preserve the highlighting of text in output file

    Hi, I tested your file again and it turned out to be correct again, even without removing the duplicating field!  The problem occured yestoday is something wrong about test program. Here is my test code, and you can tell me the result after testing with it yourself:

       AutoFiller autoFiller = new AutoFiller();
         
       autoFiller.InputFileName = "B29_1.pdf";
       autoFiller.OutputFileName = "B29_1_auto_output.pdf";

       //Construct the data table with only 3 columns

       DataTable mDataTable = new DataTable();
       DataColumnCollection columns = mDataTable.Columns;
       columns.Add("CompanyNameHospital",typeof(string));
       columns.Add("NameFormatted",typeof(string));
       columns.Add("SocialSecurityNumber",typeof(string));


       //construct two row of data which should be obtained from DB
       DataRow myRow = mDataTable.NewRow();
       myRow["CompanyNameHospital"] = "aspose.com";
       myRow["NameFormatted"] = "duplicated";
       myRow["SocialSecurityNumber"] = "23045-123-1435";
       mDataTable.Rows.Add(myRow);

       DataRow hisRow = mDataTable.NewRow();
       hisRow["CompanyNameHospital"] = "aspose.kit.com";
       hisRow["NameFormatted"] = "another one";
       hisRow["SocialSecurityNumber"] = "888-8888-8885";
       mDataTable.Rows.Add(hisRow);

       autoFiller.ImportDataTable(mDataTable);
       autoFiller.Save();

    I constructed data staticly and only filled three fields, including the duplicated one. The output file consistes of 4 correct Pages, all highlights remains.

    I would like to remind that you should pay attention to:
    1. The filled field will be flattened if you didn't call the method AutoFiller.IsFlattenField (string fieldName)
    2. Please be sure that the data obtained from DB is right for the PDF template
    3. Also be sure that you get the latest verion of Aspose.Kit.

    Sorry for the inconvinience brings to you and we will help you until it works.

    Best regards.


    Luke Fu
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
View as RSS news feed in XML