我有一个form,已在Adobe Acrobat中填写,将其保存在PDFsharp中时,所有字段中的值都将被删除。
我尝试添加NeedAppearances Elements,但没有帮助。有解决办法吗?
Private Sub PDFsharpSave(Path As String)
Dim Doc As PdfDocument = IO.PdfReader.Open(Path)
If Doc.AcroForm IsNot Nothing Then
If Doc.AcroForm.Elements.ContainsKey("/NeedAppearances") = False Then
Doc.AcroForm.Elements.Add("/NeedAppearances", New PdfSharp.Pdf.PdfBoolean(True))
Else
Doc.AcroForm.Elements("/NeedAppearances") = New PdfSharp.Pdf.PdfBoolean(True)
End If
Doc.Save(Path.Replace(".pdf", "_v2.pdf"))
End If
End Sub