6
正在試圖填補PDF格式 的領域,所以我用下面的代碼pdfsharp和內對
string filePath = @"c:\test.pdf";
string newPath = @"E\Result";
if(File.Exists(filePath))
{
PdfDocument document = PdfReader.Open(filePath, PdfDocumentOpenMode.Modify);
// Get the root object of all interactive form fields
PdfAcroForm form = document.AcroForm;
// Get all form fields of the whole document
PdfAcroField.PdfAcroFieldCollection fields = document.AcroForm.Fields; //"/Fields"
string[] names = fields.Names;
names = fields.DescendantNames;
的問題是,它給誤差的PDF名必須以斜槓(/)開始。
我dsicoverd的document.AcroForm
有4對,對其中已經鍵「/場」,如何實現它
看起來好像您從PDFsharp附帶的正在使用的AcroForms示例中獲取代碼。 也許問題出在你正在使用的PDF文件上。 –
我使用了相同的文件,併成功填充了itextsharper – AMH
PDFsharp示例代碼適用於我們的示例PDF文件。它似乎不適用於您的PDF文件。賞金是一個強大的激勵,但沒有你的PDF文件,我不能調查這個問題,因爲我不能複製這個問題。 –