I create pdf with rotativa in asp.net mvc
It works fine on localhost, but when I publish it on the web via iss, the pdf shows a blank page.
I copied the relevant dll files to the Rotativa folder
msvcr120.dll
msvcp140.dll
msvcp120.dll
I downloaded the latest version from https://wkhtmltopdf.org/
I gave all permissions to the folders
I tried all the methods in the forums
I couldn’t solve the problem
I’m waiting for your help`
enter image description here
enter image description here
``
public ActionResult PrintSalarySlip(int id)
{
// PDF oluşturulacak sayfanın adı ve parametrelerle birlikte ayarlandı
var pdfResult = new ActionAsPdf("IndexById", new { id = id })
{
PageOrientation = Orientation.Portrait,
PageSize = Rotativa.Options.Size.A4,
CustomSwitches = "--load-error-handling ignore" // Hata yönetimi için opsiyonel
};
// PDF'yi indirme olarak sunmak için bir dosya adı belirleyin
var pdfFile = pdfResult.BuildFile(ControllerContext);
// PDF dosyasını indirme olarak sunmak
return File(pdfFile, "application/pdf", "SalarySlip.pdf");
}
view
@Html.ActionLink("Göster", "PrintSalarySlip", new { id = item.P_S_ID, @class = "btn btn-info" })
----------
TRBaybars is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.