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文件,我不能调查这个问题,因为我不能复制这个问题。 –