Skip to content

Commit bad9cc5

Browse files
author
Patrick Ammann
committed
feat: allow to set AcroForm
1 parent 4c3bcbb commit bad9cc5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

PdfSharpCore/Pdf.Advanced/PdfCatalog.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,15 @@ internal PdfOutlineCollection Outlines
160160
/// </summary>
161161
public PdfAcroForm AcroForm
162162
{
163-
get
163+
get { return (PdfAcroForm)Elements.GetValue(Keys.AcroForm); }
164+
set
164165
{
165-
if (_acroForm == null)
166-
_acroForm = (PdfAcroForm)Elements.GetValue(Keys.AcroForm);
167-
return _acroForm;
166+
if (Elements.ContainsKey(Keys.AcroForm))
167+
Elements[Keys.AcroForm] = value;
168+
else
169+
Elements.Add(Keys.AcroForm, value);
168170
}
169171
}
170-
PdfAcroForm _acroForm;
171172

172173
/// <summary>
173174
/// Gets or sets the language identifier specifying the natural language for all text in the document.

0 commit comments

Comments
 (0)