|
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 < 5000) { };
//Thread.Sleep(100);
pdfs[i] = pdf;
}
using (FileStream fs = File.Create($@"C:\Temp\{DateTime.Now:yyyyMMddHHmmssfff}.pdf"))
PdfDocument.Merge(pdfs).Save(fs);
}
}
}
|
|
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!
|
|
Rank: Newbie Groups: Member
Joined: 7/26/2016 Posts: 2
|
The maintenance build indeed fixes the problems I was seeing, thank you.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Great. Thanks for confirming and sorry about the problem!
|
|
Rank: Advanced Member Groups: Member
Joined: 7/14/2014 Posts: 40
|
When will this maintenance build be posted and/or available on NuGet?
|
|
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.
|
|