I have just been playing with PDFSharp 1.50RC1 and its looking excellent! I am using it to complete a PDF form which works well but when I open the output file there are two issues:
1. I receive a message saying "This document enabled extended features in Adobe Acrobat Reader" 2. The fields are no longer editable in Adobe Acrobat Reader after the document has been amended.
I know if another PDF .NET application that you have to open the document as APPEND to resolve the same error but I haven't been able to find a way to resolve it.
Has anyone else had this and maybe could help? I have attached the code I am using below (which is pretty straight forward):
Private Sub PDFSharpFillForm() Dim mypdfdocument As New PdfSharp.Pdf.PdfDocument mypdfdocument = PdfSharp.Pdf.IO.PdfReader.Open("c:\open\form1.pdf", PdfSharp.Pdf.IO.PdfDocumentOpenMode.Modify) Dim form As PdfSharp.Pdf.AcroForms.PdfAcroForm = mypdfdocument.AcroForm If form.Elements.ContainsKey("/NeedAppearances") Then form.Elements("/NeedAppearances") = New PdfSharp.Pdf.PdfBoolean(True) Else form.Elements.Add("/NeedAppearances", New PdfSharp.Pdf.PdfBoolean(True)) End If Dim testField As PdfSharp.Pdf.AcroForms.PdfTextField = CType(form.Fields("P1_Crematorium"), PdfSharp.Pdf.AcroForms.PdfTextField) testField.Text = "My Crematorium" mypdfdocument.Save("c:\open\form1-PDFSharp.pdf") End Sub
---------------------------------------------------------------------------------------------------------------------- ANOTHER .NET PDF Application resolved this by issuing the following command when opening the document (if it helps):
PdfStamper ps = new PdfStamper(pr, fs, '\0', true);
|