Rotativa.AspNetCore icon indicating copy to clipboard operation
Rotativa.AspNetCore copied to clipboard

PDF password is not working

Open skkasi opened this issue 5 years ago • 1 comments

ViewasPDF password is set but not prompting while opening the file.

var report = new ViewAsPdf("Demoviewpdf", customerList) {
Password = "123456" }

skkasi avatar Oct 28 '19 16:10 skkasi

Password option is for passing Basic HTTP authentication, not for protecting the generated PDF with a password. If the HTML you want to transform to a PDF is protected with Basic HTTP authentication, then you can use Username and Password options to pass the authentication. The result is a PDF without password. See the description here.

Wkhtmltopdf (which Rotativa uses for generating the PDF) doesn't support password protecting PDFs.

ArjanKw avatar Aug 16 '24 13:08 ArjanKw