PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Dec 03, 2021 2:17 pm

All times are UTC

Forum rules

Please read this before posting on this forum: Forum Rules

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Mar 12, 2019 8:12 pm 

Joined: Tue Mar 12, 2019 8:02 pm
Posts: 3
Files filled out with Adobe Acrobat Pro, will stripe out all fields when saved with PDF sharp,
Try it with PDF from link below.
I tried adding NeedAppearances but that doesn't help

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))
                Doc.AcroForm.Elements("/NeedAppearances") = New PdfSharp.Pdf.PdfBoolean(True)
            End If
            Doc.Save(Path.Replace(".pdf", "_v2.pdf"))
       End If
End Sub

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group