Welcome Guest Search | Active Topics | Sign In | Register

Freeze and/or blank output with small HTML conversions Options
JDPurcell
Posted: Friday, January 28, 2022 12:16:52 PM
Rank: Newbie
Groups: Member

Joined: 7/26/2016
Posts: 2
Using EO.Pdf 21.3.18, the code below typically freezes in one of the ConvertHtml calls. There seems to be an issue with calling ConvertHtml too quickly in succession. Uncommenting the part with the stopwatch loop adds a half millisecond delay, which usually allows the code to run without freezing, but then there's a different problem where most of the pages in the output document are blank. Uncommenting the larger sleep makes the code work as expected.

This problem started in version 21.2.99. The prior version, 21.2.70, always works without freezing or blank pages.

Code: C#
using EO.Pdf;
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;

namespace EOPdfBugRepro
{
	internal class Program
	{
		static void Main(string[] args)
		{
			Runtime.AddLicense("License Key Here");
			string html = "<html><body>Testing EO.Pdf</body></html>";
			int count = 8;
			PdfDocument[] pdfs = new PdfDocument[count];
			for (int i = 0; i < count; i++)
			{
				Console.WriteLine(i);
				PdfDocument pdf = new PdfDocument();
				HtmlToPdf.ConvertHtml(html, pdf);
				//Stopwatch sw = Stopwatch.StartNew(); while (sw.ElapsedTicks &lt; 5000) { };
				//Thread.Sleep(100);
				pdfs[i] = pdf;
			}
			using (FileStream fs = File.Create($@"C:\Temp\{DateTime.Now:yyyyMMddHHmmssfff}.pdf"))
				PdfDocument.Merge(pdfs).Save(fs);
		}
	}
}
eo_support
Posted: Friday, January 28, 2022 1:30:59 PM
Rank: Administration
Groups: Administration

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

We are aware of the issue and we have a maintenance build that would fix this issue. We will PM you with the download location.

Thanks!
JDPurcell
Posted: Friday, January 28, 2022 2:45:56 PM
Rank: Newbie
Groups: Member

Joined: 7/26/2016
Posts: 2
The maintenance build indeed fixes the problems I was seeing, thank you.
eo_support
Posted: Friday, January 28, 2022 3:16:54 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Great. Thanks for confirming and sorry about the problem!
CWoods
Posted: Thursday, February 3, 2022 2:23:28 AM
Rank: Advanced Member
Groups: Member

Joined: 7/14/2014
Posts: 40
When will this maintenance build be posted and/or available on NuGet?
eo_support
Posted: Friday, February 4, 2022 10:42:16 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
CWoods wrote:
When will this maintenance build be posted and/or available on NuGet?


Currently we have no plan to post the maintenance build as we are switching to the 2022 release cycle. All the fixes will be in the initial 2022 build. If you preper to use the 2021 maintenance build please let us know and we will provide the download link to you.


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.