Welcome Guest Search | Active Topics | Sign In | Register

v23.3.13. Generates blank blocks/pages (with hidden text which could be selected by mouse) Options
Vlad Supr
Posted: Tuesday, September 5, 2023 2:56:42 AM
Rank: Newbie
Groups: Member

Joined: 9/5/2023
Posts: 2
Under pressure (we tested ~10 simultaneous reports at a time) it could randomly generate blank pages. It contains hidden text which you can select by mouse, but it's not visible in final PDF.

As workaround: Global static lock for endpoint solves the problem. Like

Code: C#
private static object _lock = new object();
....
   public async Task<...> GenerateReportEndpoint(...)
   {
      lock(_lock) {[size=3][/size][size=5][/size]
            .........
            string viewHtmlContent = ...;
            var pdfDocument = new PdfDocument();
            HtmlToPdf.ConvertHtml(viewHtmlContent, pdfDocument);
            .......
     }}

Possibility to generate only 1 report at a time that's not how it should work in production.
-.Net Framework 4.8
-ASP.NET MVC

Could we have it fixed, please ?
eo_support
Posted: Tuesday, September 5, 2023 10:34:01 AM
Rank: Administration
Groups: Administration

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

Can you send a result HTML with the blank text to us so that we can take a look? You can use the contact us page to send us the PDF file:

https://www.essentialobjects.com/contact

Thanks!
Pavel
Posted: Friday, September 8, 2023 2:29:48 AM
Rank: Newbie
Groups: Member

Joined: 9/8/2023
Posts: 1
Hi Team,
We shared our HTML result with the blank text, but haven't heard back yet. Please, let us know how the investigation going. We are currently monitoring the lock workaround solving the problem, but we certainly need to find a proper fix for it. It affects about 10% of pdf files generated at the moment under the heavy load.
eo_support
Posted: Friday, September 8, 2023 11:18:20 AM
Rank: Administration
Groups: Administration

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

We looked into the PDF file you sent to us. The issue has to do with the page header. The page header has a full page size white background and this white background is what blocked the main contents. In another word, the main contents are correctly generated, however they are subsequently covered by a full page white "cover" that is a part of your page header. So the issue is the page header, not the main contents. How do you generate the page header?

Thanks!
Vlad Supr
Posted: Monday, September 11, 2023 1:14:50 PM
Rank: Newbie
Groups: Member

Joined: 9/5/2023
Posts: 2
We apply header and footer in the code like that.
In our multithreading tests it makes ~50-60% of broken pages for really the +- same html's.


var pdfDocument = new PdfDocument();
HtmlToPdf.ConvertHtml(viewHtmlContent, pdfDocument, options);

var pagesCount = pdfDocument.Pages.Count;
for (var i = 0; i < pagesCount; i++)
{
options.OutputArea = new RectangleF(headerLeft, headerTop, headerWidth, headerHeight);
HtmlToPdf.ConvertHtml(headerViewHtmlContent, pdfDocument.Pages[i], options);

options.OutputArea = new RectangleF(0, 11.2f, footerWidth, 1);
HtmlToPdf.ConvertHtml(footerViewHtmlContent, pdfDocument.Pages[i], options);
}
eo_support
Posted: Monday, September 11, 2023 8:58:39 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
We are not aware that ConvertHtml will automatically render enlarged white background. So the problem is more likely in your html. Please try to replace it with fixed hardcoded html as a test. If that problem still occurs after that, please try to isolate the problem into a test project and send the test project to us. Once we have that we will be happy to look further.


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.