PdfSharpCore icon indicating copy to clipboard operation
PdfSharpCore copied to clipboard

Viewing filled in form fields not working in Safari

Open jsa061 opened this issue 2 years ago • 1 comments

If you have a form, with a form field, and use Pdf Sharp Core to fill inn the form field, it will not show when you open the PDF in safari.

Steps to reproduce

Create a form with a form field. Adobe acrobat => tools => prepare form.

pdf-form

Fill in form field with Pdf Sharp Core ( .net 7)

        var pdf = PdfReader.Open("C:\\PdfSharpCore\\FullNameForm.pdf", PdfDocumentOpenMode.Modify);
        var form = pdf.AcroForm;

        form.Elements.Add("/NeedAppearances", new PdfBoolean(true));

        var pdfTextFieldFullName = (PdfTextField)(form.Fields["FullName"]);

        pdfTextFieldFullName.Value = new PdfString("Justin Sand", PdfStringEncoding.PDFDocEncoding);
        pdfTextFieldFullName.ReadOnly = true;
        pdf.Save("c:\\PdfSharpCore\\FullName.pdf");
        pdf.Close();

PDF in Safari

image

Pdf in Chrome:

image

jsa061 avatar Feb 08 '23 13:02 jsa061

+1

maattss avatar Feb 08 '23 13:02 maattss