Search code examples
.netpdf.net-corepdf-generationpdfsharp

when filling a pdf document with pdfsharp, the filled form doesn't show the values unless the fields are clicked on


When filling a pdf document with pdfsharp (pdfsharpcore), the filled form doesn't show the values in the acrobat reader unless the fields are clicked on.


Solution

  • In order to make the values visible, I've inserted.

    if (acroForms.Elements.ContainsKey("/NeedAppearances"))
        acroForms.Elements["/NeedAppearances"] = new PdfBoolean(true);
    else
        acroForms.Elements.Add("/NeedAppearances", new PdfBoolean(true));
    

    and it works.