Replies: 7 comments
-
This is not enough. You should wait until the image loads too. Perhaps this will do the trick.
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@skalahonza what happens when you print to PDF in chrome? |
Beta Was this translation helpful? Give feedback.
-
@kblok |
Beta Was this translation helpful? Give feedback.
-
This can happen if you're loading images over HTTPS while the page is served over HTTP. |
Beta Was this translation helpful? Give feedback.
-
As others suggested in other issues. I enabled ignoring of https errors for local development. |
Beta Was this translation helpful? Give feedback.
-
For those encountering similar issues, the problem was lazy loading. Images not initially visible on the page with lazy loading activated failed to render.
Removing the lazy loading attribute from the image element resolved the issue, and PDF generation functioned properly once more. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am encountering an issue while converting HTML to PDF using PuppeteerSharp. Specifically, the images are not displaying in the generated PDF. Despite following various solutions suggested on StackOverflow, the problem persists. Below is the method I am using to perform the HTML to PDF conversion. I would appreciate any guidance or solutions you could provide.
public async Task HtmlToPdf(string htmlContent, string fileName)
{
var startTime = DateTimeOffset.UtcNow;
_logger.LogInformation("Executing GeneratePdf: {fileName}...", fileName);
}
Beta Was this translation helpful? Give feedback.
All reactions