Generate ReadOnly Pdf

HtmlLoadOptions options = new HtmlLoadOptions(pathToTempFolder);
options.UseNewConversionEngine = true;

Document pdfDocument = new Document(htmlFilePath, options);
pdfDocument.Save(string.Format("{0}generatedPDF.pdf", pathToTempFolder));


I want to save my pdf as a read only PDF ..
couldn't find any code for Document.
as there is something like this below, I dont want to use PDF generator.
Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();

//Assign a security instance to Pdf object
pdf1
.Security = new Aspose.Pdf.Generator.Security();

//Restrict annotation modification
pdf1
.Security.IsAnnotationsModifyingAllowed = false;



Hi Sepideh,

Thanks for your inquiry. Please check following documentation link for setting privileges on an existing PDF document. To create read only file you can forbid all privileges and only allow printing. Hopefully it will help you to accomplish your requirements.

Please feel free to contact us for any further assistance.

Best Regards,