You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm trying to generate a PDF, the produced document is empty/blank.
To Reproduce
using QuestPDF.Fluent;
using QuestPDF.Infrastructure;
QuestPDF.Settings.License = LicenseType.Community;
for (int i = 0; i < 10; i++)
{
var document = Document.Create(container =>
{
container.Page(async page =>
{
await Task.Delay(10);
page.Content().Text(DateTime.Now.ToString());
});
});
document.GeneratePdf("c:\\temp\\pdf_" + i + "doc.pdf");
}
Expected behavior
10 generated PDF with the current datetime as content.
But only one is correctly generated as shown below in the screenshot. Sometimes zero document is correctly generated.
Screenshots
Environment
What version of the library do you use? 2024.3.4, same behavior with old versions.
What operating system do you use? (OS type, x64 vs x86 vs arm64) x64
Additional context
If I remove async/await from the PageDescriptor, I've no issue but I need to be able to call some external API/Database to get contextual data that I can't operate outside.
Thanks for your support.
The text was updated successfully, but these errors were encountered:
The PDF generation process is synchronous. If you need to call any external async resources, please do it before the generation and provide all necessary data through a DTO model.
Describe the bug
I'm trying to generate a PDF, the produced document is empty/blank.
To Reproduce
Expected behavior
10 generated PDF with the current datetime as content.
But only one is correctly generated as shown below in the screenshot. Sometimes zero document is correctly generated.
Screenshots
Environment
What version of the library do you use? 2024.3.4, same behavior with old versions.
What operating system do you use? (OS type, x64 vs x86 vs arm64) x64
Additional context
If I remove async/await from the PageDescriptor, I've no issue but I need to be able to call some external API/Database to get contextual data that I can't operate outside.
Thanks for your support.
The text was updated successfully, but these errors were encountered: