我正在尝试填写pdf表单的字段并具有以下代码:
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;
}
问题是它给出了错误“ A PDF name must start with a slash (/)
”。
我发现document.AcroForm
有4对,其中之一具有键“ / Fields”。如何到达?
我们无法复制错误“ PDF名称必须以斜杠(/)开头”。以及您提供的示例文件。
您提供的示例文件使用了PDFsharp不支持的PDF功能。此文件不能与PDFsharp一起使用。
不是您要的答案。这个答案实际上并没有帮助,但是如果没有适当的示例文件,我们将无法为您提供帮助。