Exemple #1
0
 /// <summary>
 /// Merges existing FieldsObject and children FieldObject entities into the form of the pdf document
 /// associated with it.
 /// </summary>
 /// <param name="fieldsObject">object containing acroform fields data to be merged.</param>
 /// <param name="form">acroform to be filled with xfdf data.</param>
 private void MergeFields(FieldsObject fieldsObject, PdfAcroForm form)
 {
     if (fieldsObject != null && fieldsObject.GetFieldList() != null && !fieldsObject.GetFieldList().IsEmpty())
     {
         IDictionary <String, PdfFormField> formFields = form.GetFormFields();
         foreach (FieldObject xfdfField in fieldsObject.GetFieldList())
         {
             String name = xfdfField.GetName();
             if (formFields.Get(name) != null && xfdfField.GetValue() != null)
             {
                 formFields.Get(name).SetValue(xfdfField.GetValue());
             }
             else
             {
                 logger.Error(iText.IO.LogMessageConstant.XFDF_NO_SUCH_FIELD_IN_PDF_DOCUMENT);
             }
         }
     }
 }
Exemple #2
0
 private void MergeFields(FieldsObject fieldsObject, PdfAcroForm form)
 {
     if (fieldsObject != null && fieldsObject.GetFieldList() != null && !fieldsObject.GetFieldList().IsEmpty())
     {
         IDictionary <String, PdfFormField> formFields = form.GetFormFields();
         foreach (FieldObject xfdfField in fieldsObject.GetFieldList())
         {
             String name = xfdfField.GetName();
             if (formFields.Get(name) != null && xfdfField.GetValue() != null)
             {
                 formFields.Get(name).SetValue(xfdfField.GetValue());
             }
             else
             {
                 logger.Error("No such field in pdf document!");
             }
         }
     }
 }
Exemple #3
0
 public virtual void SetFields(FieldsObject fields)
 {
     this.fields = fields;
 }