如何使用iTextSharp将PdfTable添加到现有的pdf文档中

时间:2015-01-21 17:40:50

标签: c# pdf itext

以下是我打开现有pdf并为字段添加一些值的方法:

public static byte[] GeneratePdf(string pdfPath, Dictionary<string, string> formFieldMap)
    {
        var output                      = new MemoryStream();
        var reader                      = new PdfReader(pdfPath);

        var stamper                     = new PdfStamper(reader, output);
        var formFields                  = stamper.AcroFields;


        foreach (var fieldName in formFieldMap.Keys)
            formFields.SetField(fieldName, formFieldMap[fieldName]);

        stamper.FormFlattening          = true;
        stamper.Close();
        reader.Close();

        return output.ToArray();
    }

您能告诉我如何在此上下文中添加PdfTable对象吗?

0 个答案:

没有答案