Welcome Guest Search | Active Topics | Sign In | Register

LoadHtml(string html) method is resulting unexpected error Options
Karthick M
Posted: Tuesday, September 23, 2025 3:01:41 AM
Rank: Member
Groups: Member

Joined: 6/16/2014
Posts: 28
Hi,

We are upgrading the EO.pdf version from 19.2.11.0 to 25.2.36.0. Used this to convert HTML to PDF

Currently, we have two implementations:
User Report - an on-demand functionality where data is exported to PDF.
Scheduler - a feature that schedules reports for export at specific times.

After upgrading to 25.2.36.0 version, the on-demand reports are functioning correctly. However, the scheduler is returning errors.

To narrow down the analysis and identify the root cause, we replaced our existing code with the following simple implementation using sample HTML:

Sample Code:
Code: C#

using (HtmlToPdfSession session = HtmlToPdfSession.Create())
{
LogMessage("HtmlToPdfSession Test - Created");
LogMessage("html1 updated");
string html1 = "<!DOCTYPE html><html><body><h1>My First Heading</h1></body></html>";
session.LoadHtml(html1);
string AbsoluteFilename1 = pdfPath.TrimEnd(new char[] { '\\\\' }) + "\\\\" + filename + ".pdf";
LogMessage("Render" + AbsoluteFilename1);
session.RenderAsPDF(AbsoluteFilename1);
}

Upon comparing the logs, we identified the following difference between the on-demand logs and the scheduler logs:

Scheduler Logs:

23/09/2025 06:43:07 - 23/09/2025 06:43:07 - Managed Thread Id: {22}
Message : DEBUG CONSOLE OUTPUT:
Source: https://hic045248.global.ds.honeywell.com/eo_loadhtml_d6f15c9b-e35c-42f4-a2a4-7c94078d34fc.html
Line #: 0
Severity: Error
Failed to load resource: the server responded with a status of 404 ()



We suspect the LoadHtml(html) method is causing this issue. Please assist us in finding a solution, and let me know if you need any additional details.
eo_support
Posted: Wednesday, September 24, 2025 8:37:10 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,421
Hi,

Are you able to reproduce this problem consistently on any computer or only a a specific computer? The Url that you observed is an internal Url that should have never been sent out to your server. The fact that it was sent to the server and received a response (404) indicates a problem somewhere with the internal Url handling mechanism. We would need to add more logs in order to find out what went wrong. Ideally if you can provide remote access to a system where this problem can be reproduced consistly, we can connect to it and upload test code/DLLs to it to get to the root of the problem. If that's not possible, we can add logs and send test builds to you for you to collect logs for us.

Thanks!
Karthick M
Posted: Thursday, September 25, 2025 12:19:00 AM
Rank: Member
Groups: Member

Joined: 6/16/2014
Posts: 28
Hi,

It's happening consistently on any computer and we will not be able to give remote access.
Karthick M
Posted: Thursday, September 25, 2025 5:03:17 AM
Rank: Member
Groups: Member

Joined: 6/16/2014
Posts: 28
Please let us know,if you want to connect for a call.so we can show a demo or send logs or test build,so we can check for more logs
eo_support
Posted: Thursday, September 25, 2025 9:27:30 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,421
Can you update to build 25.2.64 and then capture the runtime log:

https://www.essentialobjects.com/doc/common/collect_logs.html

After you have the log, you can send it to us through contact us page:

https://www.essentialobjects.com/contact

We will look into the log to see what we can find, and then possibliy add new logs entries and send you additional test build to collect more logs.

Thanks!
eo_support
Posted: Friday, September 26, 2025 12:42:47 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,421
Hi,

We have looked into the log and it appears that somewhere in your code you have set HtmlToPdfOptions.BaseUrl to the following value:

Code:
https://hic045248.global.ds.honeywell.com:443


Here port number 443 is redundant since that's the default HTTPS port number. However our code did not correctly handle this case which results in the error. To fix the problem, you need to change BaseUrl to the value without the port number:

Code:
https://hic045248.global.ds.honeywell.com


We will also change our code so that in our next build these two Urls will be treated as the same internally thus you will no longer receive the error with BaseUrl set to either value.

Thanks!

Karthick M
Posted: Monday, September 29, 2025 8:30:12 AM
Rank: Member
Groups: Member

Joined: 6/16/2014
Posts: 28
It worked after removing port.
Thanks!
eo_support
Posted: Monday, September 29, 2025 8:55:11 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,421
Great. Thanks for confirming!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.