0
I’m trying to generate a PDF with Rotary, I can normally on Local, but when I publish it displays error 404.
I’ve already added Dlls to the project.
public IActionResult ConfirmaReimpressaoCertificadoPDF(Certidao certificado)
{
var usuarioBase = certificadoRepository.GetCertificado(certificado.RG);
if (usuarioBase == null)
{
}
return new ViewAsPdf("ConfirmaReimpressaoCertificadoPDF", usuarioBase)
{
FileName = "Certidao.pdf"
};
}
The Startup:
RotativaConfiguration.Setup(env, "..\\wwwroot\\Rotativa\\");
There is a Warn and a LOG ERROR:
warn: Microsoft.AspNetCore.Httpspolicy.Httpsredirectionmiddleware[3] Failed to determine the https port for redirect.
fail: Microsoft.AspNetCore.Diagnostics.Exceptionhandlermiddleware[1] An unhandled Exception has occurred while executing the request. System Exception. At rotary.AspNetCore.Wkhtmldriver.Convert(String wkhtmlPath, String switches, String html, String wkhtmlExe) At rotary.AspNetCore.Wkhtmltopdfdriver.Converthtml(String wkhtmltopdfPath, String switches, String html)
Which URL is generated?
– Jéf Bueno
SERVER/Controller/Action
– Thiago Barros
Mime type PDF is enabled on the server?
– Leandro Angelo
It is. I checked. I think it has to do with the Server or IIS version I am using the 8.
– Thiago Barros