Pdf's fields should remain editable using itextsharp in asp.net

前端 未结 2 1968
不知归路
不知归路 2021-01-24 16:56

I have a fillable pdf. In which i have few textboxes.

I fill these fields by using following code(itextsharp).

 DataTable dt = new DataTable();
                  


        
2条回答
  •  温柔的废话
    2021-01-24 17:50

    Error: Cannot convert type in PDFHelper.cs

    public static Dictionary GetFormFieldNames(string pdfPath)
        {
            var fields = new Dictionary();
    
            var reader = new PdfReader(pdfPath);
            foreach (DictionaryEntry entry in reader.AcroFields.Fields) //ERROR: 'System.Collections.Generic.KeyValuePair' to 'System.Collections.DictionaryEntry'
            {
                fields.Add(entry.Key.ToString(), string.Empty);
            }
            reader.Close();
    
            return fields;
        }
    

    'System.Collections.Generic.KeyValuePair' to 'System.Collections.DictionaryEntry'

提交回复
热议问题