When Generating PDF with Rotary viewPDF does not display - error 404 - Works Only Local

Asked

Viewed 287 times

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?

  • SERVER/Controller/Action

  • Mime type PDF is enabled on the server?

  • It is. I checked. I think it has to do with the Server or IIS version I am using the 8.

1 answer

0

Guys, problem solved, after installation via Nuget, have to download and copy the exe’s and the Dll s (msvcp120.dll,msvcr120.dll, wkhtmltox.dll)This first sdois takes on the system, into the Rotary folder directly, my case via FTP even.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.