tuespetre / TuesPechkin

A .NET wrapper for the wkhtmltopdf library with an object-oriented API.
326 stars 116 forks source link

Tuespechkin takes a long time to respond, and returns null #180

Open merdonalds opened 5 years ago

merdonalds commented 5 years ago

Hey guys,

I'm currently using in my project TuesPechkin version 2.1.1, and also TuesPechkin.Wkhtmltox.AnyCPU v0.12.4.1

This is some of my code:

byte[] result = null; try { var globalSettings = CreateGlobalSettings(portraitMode); var objectSettings = CreateObjectSettings(websiteUrl, urlParameters); var document = new HtmlToPdfDocument { GlobalSettings = globalSettings }; document.Objects.Add(objectSettings); CreateEventLog.CreateInformationLog("Ready to convert PDF"); result = Converter.Convert(document); CreateEventLog.CreateInformationLog(result == null ? "Conversion failed using the Pechkin library" : "PDF conversion finished");

I run this code in 3 different environments:

Server A and Server B have the same setup (CPU, RAM, etc) There's no peak increase on Server B during conversion.

Any suggestions/ideas?

jackiemanzzz commented 5 years ago

Did you try without AnyCpu dll? I faced to similar problem when installed AnyCpu dll. So that, I changed my .dll from AnyCpu to x86 dll

merdonalds commented 5 years ago

I found what the issue is.

The URL I'm trying to convert is in a Presentation Layer, which is deployed in a separate server. Pechkin converter is in a Business Layer.

In Server A, I can access the URL from the Business Server. In Server B, I cannot access the URL from the Business Server.

This is probably some firewall exception that needs to be created.

It would be nice though to have TuesPechkin, returning an error saying it cannot access the URL.