2016-06-14 4 views
1

Я используюrotativa не служит колонтитулы SSL

 string customSwitches = string.Format("--header-html \"{0}\" " + 
         "--header-spacing \"0\" " + 
         "--footer-html \"{1}\" " + 
         "--footer-spacing \"10\" " + 
         "--footer-font-size \"10\" " + 
         "--header-font-size \"10\" , Url.Action("xxx", "xxxx", new { hid = xxxx.ID }, httType), Url.Action("Footer", "xxxxx", new { hid = xxxxx.ID }, httType)); 

    var actionResult = new Rotativa.ViewAsPdf("Letter") 
     { 
      FileName = gid.ToString(), 
      CustomSwitches = customSwitches 
     }; 

, который отлично работает локально и на испытании, но как только я положил его в прямом эфире (с SSL) он падает со следующей ошибкой: -

System.Exception: 
Error: Failed loading page https://xxxxxxxxx/xxxxxxxx/header?hid=0 (sometimes it will work just to ignore this error with --load-error-handling ignore) Error: Failed loading page https://134.213.201.226/Discharge/Footer?hid=0 (sometimes it will work just to ignore this error with --load-error-handling ignore) Exit with code 1 due to network error: UnknownNetworkError 

System.Exception: Error: Failed loading page https://xxxxxxx/xxxxxxxx/header?hid=0 (sometimes it will work just to ignore this error with --load-error-handling ignore) 
Error: Failed loading page https://xxxxxxxxxx/xxxxxxxxx/Footer?hid=0 (sometimes it will work just to ignore this error with --load-error-handling ignore) 
Exit with code 1 due to network error: UnknownNetworkError 
at Rotativa.WkhtmltopdfDriver.Convert(String wkhtmltopdfPath, String switches, String html) 
    at Rotativa.WkhtmltopdfDriver.ConvertHtml(String wkhtmltopdfPath, String switches, String html) 
    at Rotativa.ViewAsPdf.CallTheDriver(ControllerContext context) 
    at Rotativa.AsPdfResultBase.BuildPdf(ControllerContext context) 

любая идея, почему верхний и нижний колонтитулы не будут отображаться вживую? когда я перехожу к верхнему и нижнему колонтитулу через браузер, который они отображают на странице.

+0

, чтобы добавить еще один поворот, когда на реальном сервере также будет отображаться PDF – chris

ответ

0

Вы должны добавить следующие библиотеки DLL в вашем веб-приложение в папку «Rotativa»: (я думаю, у вас уже есть с файлом «wkhtmltopdf.exe»)

msvcp120.dll, msvcr120.dll , vccorlib120.dll.

Эти файлы находятся в «C: \ Windows \ SysWOW64».

1

Я думаю, что это внутренняя проблема с Rotativa. Тем не менее, это способ, которым мой коллега придумал, как работа.

На сервере, перейдите в C: \ Windows \ System32 \ Drivers \ Etc

открыть файл '' хостов

Добавьте ваш сервер IP следуют вашим имя хоста. Например: 127.0.0.1 www.stackoverflow.com