PDF creation is not working on our new server

110 views
Skip to first unread message

Neha

unread,
Nov 12, 2023, 8:05:32 PM11/12/23
to wkhtmltopdf General
Hi,

I'm using the Rotativa 1.6.4 Nuget package in our .net MVC(5.2.3) web application. 

I have copied following files in the Rotativa folder of my Visual Studio project. The same files are copied across to the project release folder on our new web server hosting the web application.
wkhtmltopdf.exe (0.12.2.1)
msvcp120.dll (12.0.21005.1)
msvcr120.dll (12.0.21005.1)
vccorlib120.dll (12.0.21005.1)

The PDF creation works as expected in our development environment. 
But on our new web server PDF creation is not working. The following error is thrown on calling Rotativa.ActionAsPdf.BuildPdf.

11/11/2023 3:44:13 PM: Exception:System.Exception: Error: Failed loading page https://<WebsiteDomainName>/GeneratePDF?staffToken=<token> (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.Convert(String wkhtmltopdfPath, String switches)
   at Rotativa.AsPdfResultBase.CallTheDriver(ControllerContext context)
   at Rotativa.AsPdfResultBase.BuildPdf(ControllerContext context)

11/11/2023 3:44:13 PM: Exception:System.Exception: BUILD_PDF - System.Exception: Error: Failed loading page https://<WebsiteDomainName>/GeneratePDF?staffToken=<token>  (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.Convert(String wkhtmltopdfPath, String switches)
   at Rotativa.AsPdfResultBase.CallTheDriver(ControllerContext context)
   at Rotativa.AsPdfResultBase.BuildPdf(ControllerContext context)


Oure new server configuration:
Windows Server 2022 Standard(64 bit)
Microsoft Visual C++ 2015-2019 Redistributable(x64) - 14.29.30133
Microsoft Visual C++ 2015-2019 Redistributable(x86) - 14.29.30133


PDF generation was working on our old server which is with following configuration:
Windows server 2012 R2 standard (64 bit)
Microsoft Visual C++ 2015-2019 Redistributable(x64) - 14.27.29112
Microsoft Visual C++ 2015-2019 Redistributable(x86) - 14.27.29112
Microsoft Visual C++ 2012 Redistributable(x64) - 11.0.61030
Microsoft Visual C++ 2008 Redistributable(x64) - 9.0.30729.6161
Microsoft Visual C++ 2008 Redistributable(x86) - 9.0.30729.6161

HTTPS redirection is enabled in the application Web.config on both our old and new servers.

Appreciate if you could let me know how to get the PDF creation working on our new server. Is it enough that 'Microsoft Visual C++ 2015-2019 Redistributable' is installed on our new server or, do we need to install one of the older versions of 'Microsoft Visual C++ Redistributable' on our new server to get the PDF creation installed? Or are we missing something else?

Your help on this is most appreciated.

Many Thanks

Rajiv K

unread,
Nov 14, 2023, 4:27:13 AM11/14/23
to wkhtmltop...@googlegroups.com
please check IIS server setting 


On Mon, Nov 13, 2023 at 1:11 AM Neha <gadensl...@gmail.com> wrote:
Boxbe This message is eligible for Automatic Cleanup! (gadensl...@gmail.com) Add cleanup rule | More info
--
===================================================
You received this message because you are subscribed to the "wkhtmltopdf General" group.
To post to this group, send email to wkhtmltop...@googlegroups.com
To unsubscribe from this group, send email to wkhtmltopdf-gen...@googlegroups.com
 
For more options, visit this group at
http://groups.google.com/group/wkhtmltopdf-general?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups "wkhtmltopdf General" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wkhtmltopdf-gen...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wkhtmltopdf-general/cce2db5b-e8a4-4286-85f2-4e5f4677f30an%40googlegroups.com.

Neha

unread,
Nov 15, 2023, 7:10:01 AM11/15/23
to wkhtmltopdf General
Which IIS server setting?

Rajiv K

unread,
Nov 15, 2023, 7:43:45 AM11/15/23
to wkhtmltop...@googlegroups.com
Where is your app deployed ??

On Wed, Nov 15, 2023 at 12:17 PM Neha <gadensl...@gmail.com> wrote:
Boxbe This message is eligible for Automatic Cleanup! (gadensl...@gmail.com) Add cleanup rule | More info
Which IIS server setting?

On Tuesday, November 14, 2023 at 8:27:13 PM UTC+11 ra...@crm-masters.com wrote:

Neha

unread,
Nov 15, 2023, 7:09:17 PM11/15/23
to wkhtmltopdf General
I mean which specific IIS setting I need to check on the hosting server?

Rajiv K

unread,
Nov 16, 2023, 2:19:00 AM11/16/23
to wkhtmltop...@googlegroups.com
go to advanced setting for that site and made false for "Preload Enabled"

On Thu, Nov 16, 2023 at 12:19 AM Neha <gadensl...@gmail.com> wrote:
Boxbe This message is eligible for Automatic Cleanup! (gadensl...@gmail.com) Add cleanup rule | More info
I mean which specific IIS setting I need to check on the hosting server?

On Wednesday, November 15, 2023 at 11:43:45 PM UTC+11 ra...@crm-masters.com wrote:

Neha

unread,
Nov 16, 2023, 6:52:45 PM11/16/23
to wkhtmltopdf General
Thanks for the tip. But our issue was finally resolved by changing firewall rules to enable URLs with application domain name to be called within the server. The issue was calling the PDF creation URL with the application domain name within the server.

Rajiv K

unread,
Nov 17, 2023, 4:35:24 AM11/17/23
to wkhtmltop...@googlegroups.com
Great.. that was other issue .. your PDF generation file is on other server 


On Thu, Nov 16, 2023 at 11:53 PM Neha <gadensl...@gmail.com> wrote:
Boxbe This message is eligible for Automatic Cleanup! (gadensl...@gmail.com) Add cleanup rule | More info
Thanks for the tip. But our issue was finally resolved by changing firewall rules to enable URLs with application domain name to be called within the server. The issue was calling the PDF creation URL with the application domain name within the server.

On Thursday, November 16, 2023 at 6:19:00 PM UTC+11 ra...@crm-masters.com wrote:
Reply all
Reply to author
Forward
0 new messages