Rotativa.AspNetCore
Rotativa.AspNetCore copied to clipboard
PDF password is not working
ViewasPDF password is set but not prompting while opening the file.
var report = new ViewAsPdf("Demoviewpdf", customerList)
{
Password = "123456"
}
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.