"fix" checked radio buttons of existing PDFform before merging with cd.AddTemplate
I'm using vb.net with itextsharp to collect several PDF-files including forms. The collected files are merged to one whole ".pdf" file using the itextsharp cb.AddTemplate-function (after eventually rotating and/or scaling them). By merging the files this way form data gets lost.
I've been able to "fix" text filled into pdf-form's text fields to the form by using:
Code:
stamper.FormFlattening = True
before merging the file with other files
The problem not solved by using
Code:
stamper.FormFlattening = True
is that the forms can have radio buttons too, which get lost when I'm using cd.AddTemplate.
I've tried to set the fields to "Read-Only" using this:
Code:
Dim fields() As String = stamper.AcroFields.Fields.[Select](Function(x) x.Key).ToArray()
For key As Integer = 0 To fields.Count - 1
stamper.AcroFields.SetFieldProperty(fields(key), "setfflags", PdfFormField.FF_READ_ONLY, Nothing)
Next
The seems to be good for the worked original file. But after merging it the checks are gone.
Is there a possibility to fix/mount/burn the checks to the buttons?
Regards, Andreas