Francois
Francois

Reputation: 10978

set PDF field read only using XFA

How can I set field "read only" in PDF using XFA and iTextSharp? I know that I have to modify the XML, but I don't know which attribute/value to set.

var attr = xfa.DomDocument.CreateAttribute("fflags");
attr.Value = "1";
xfa.DomDocument.GetElementsByTagName("my_field")[0].Attributes.Append(attr);

Upvotes: 0

Views: 661

Answers (1)

harun
harun

Reputation: 1919

I haven't used iTextSharp but the attribute in XFA that you are looking for is the access attribute on the field. And the value is "readOnly".

<field access="readOnly">

will make the field read only.

Upvotes: 0

Related Questions