I want to show pictures in PDF with HtmlRenderer.PdfSharp. I am using this example. https://github.com/ArthurHub/HTML-Renderer
I can show this link in PDF. https://helpx.adobe.com/content/dam/help/en/stock/how-to/visual-reverse-image-search/jcr_content/main-pars/image/visual-reverse-image-search-v2_intro.jpg
But I can't show this link in PDF. https://images.data.gov.sg/api/traffic-images/2016/02/96128cfd-ab9a-4959-972e-a5e74bb149a9.jpg
Because when you enter this link, the picture is downloaded automatically and is not displayed in the browser.
This code generates the PDF.
private void OnGeneratePdf_Click(object sender, EventArgs e)
{
PdfGenerateConfig config = new PdfGenerateConfig();
config.PageSize = PageSize.A4;
config.SetMargins(20);
var doc = PdfGenerator.GeneratePdf(_mainControl.GetHtml(), config, null, DemoUtils.OnStylesheetLoad, HtmlRenderingHelper.OnImageLoadPdfSharp);
var tmpFile = Path.GetTempFileName();
tmpFile = Path.GetFileNameWithoutExtension(tmpFile) + ".pdf";
doc.Save(tmpFile);
Process.Start(tmpFile);
}
This is the error I get when pasting the link.
That's how I solved the problem.