我正在使用PdfDictionary
并编写以下内容
PdfDictionary sv = new PdfDictionary();
sv["/Type"] = new PDFName("/SV");
sv["/Filter"] = new PDFName("Abc");
sv["/Ff"] = new PDFNumber(1);
signame.Dictionary["/SV"] = sv;
PDFArray arReasons = new PDFArray();
arReasons.Add(new PDFString(string.Format("CToken::{0}", customxml)));
arReasons.Add(new PDFString(reason));
v.Put(PdfName.arReasons);
但它给了我以下错误搜索了很多但没有积极的结果
Error 1 Cannot apply indexing with [] to an expression of type 'iTextSharp.text.pdf.PdfDictionary' C:\Users\lenovo\Dropbox\updated C# app\WindowsFormsApplication1\WindowsFormsApplication1\Form2.cs 134 17 WindowsFormsApplication1
我得到的其他错误是: -
Error 9 'iTextSharp.text.pdf.PdfName' does not contain a definition for 'arReasons' C:\Users\lenovo\Dropbox\updated C# app\WindowsFormsApplication1\WindowsFormsApplication1\Form2.cs 145 32 WindowsFormsApplication1
Error 3 'string' does not contain a definition for 'Dictionary' and no extension method 'Dictionary' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?) C:\Users\lenovo\Dropbox\updated C# app\WindowsFormsApplication1\WindowsFormsApplication1\Form2.cs 141 25 WindowsFormsApplication1
Error 8 The name 'reason' does not exist in the current context C:\Users\lenovo\Dropbox\updated C# app\WindowsFormsApplication1\WindowsFormsApplication1\Form2.cs 144 45 WindowsFormsApplication1
以防万一有人也帮助我