Is there anyway i can disable/lock the saved PDF after using RadFixedDocument to fill up the form field?
I do not want user to edit the field's content after they have filling up a web form and i merged the data to to the predefined PDF form.
Thank you.
1 Answer, 1 is accepted
0
Dimitar
Telerik team
answered on 20 Feb 2020, 01:53 PM
Hi Jimmy,
You can use the following approach for this:
var provider = new PdfFormatProvider();
var document = provider.Import(File.ReadAllBytes(@"..\..\filled_form.pdf"));
var fields = document.AcroForm.FormFields;
foreach (var item in fields)
{
item.IsReadOnly = true;
}
using (FileStream fs = new FileStream(@"..\..\readOnly.pdf", FileMode.OpenOrCreate))
{
provider.Export(document, fs);
}
I hope this helps. Should you have any other questions do not hesitate to ask.
Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.