【发布时间】:2012-10-18 20:57:50
【问题描述】:
我们需要获取包含特定PdfTextField的PpdfPage,怎么做?
代码:
PdfDocument document = PdfReader.Open("C:\\filex.pdf", 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 = form.Fields;
PdfTextField textfield1= (PdfTextField)fields["textfield1"];
//how to get the correct page reference respect the especified field?
PdfPage page = textfield1.Owner.Pages[???];
【问题讨论】:
-
你用的是什么库 itextsharp?
-
根据标签是pdfsharp。
-
@retslig PdfSharp,我们过去使用过 itextsharp,但 PdfSharp 许可证更加开放