HTML to PDF produces editable fields

I have a cshtml view I am using for a template for a pdf. In the view I use a TextBoxFor that gives me a textbox around my form fields. When I use the PDF library to produce a PDF and display it in a browser the textbox fields can be edited. I would like to keep the textbox but make the whole form readonly.

I have tried to make the textbox readonly:

Html.TextBoxFor(p => p.BusinessAreaCode, new { disabled = “disabled” })

I have also tried to make the pdf readonly by:

DocumentPrivilege privilege = DocumentPrivilege.ForbidAll;
PdfFileSecurity fileSecurity = new PdfFileSecurity(pdfDocument);
fileSecurity.SetPrivilege(privilege);

@randy.gordey

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input HTML.
  • Please attach the output PDF file that shows the undesired behavior.
  • Please attach the expected output PDF file that shows the desired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.