本文介绍了我如何枚举所有字段在iTextSharp的PDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

比方说,我已经加载使用iTextSharp的PDF文件:

  PdfStamper P = GetDocument(); 
AcroFields AF = ps.AcroFields;



我如何获得对文档的所有字段名的列表 AF ?


解决方案

  AcroFields AF = ps.AcroFields; 

的foreach(在af.Fields VAR场)
{
Console.WriteLine({0},{1},
field.Key,
field.Value);
}


Let's say I've loaded a PDF file using iTextSharp:

PdfStamper p = GetDocument();
AcroFields af = ps.AcroFields;

How do I get a list of all field names on the document from af?

解决方案
AcroFields af = ps.AcroFields;

        foreach (var field in af.Fields)
        {
            Console.WriteLine("{0}, {1}",
                field.Key,
                field.Value);
        }

这篇关于我如何枚举所有字段在iTextSharp的PDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 21:55