Hello,
I use princexml to generate PDF from html.
I have some graph images that are dynamic generated on-fly. When I generate PDF sometimes that images not load in PDF, some load.. I think it's related to timeload of images.
In my html I try to fix by adding:
<link rel="preload" as="image" href="{$fpimg}" />
or
#preloadedImages{
width: 0px;
height: 0px;
display: inline;
background-image: url({$fpimg});
background-image: url();
}
or
var errcnt = 0;
$("img").error(function () {
if(errcnt < 3){
src = $(this).attr("src");
$(this).attr("src", src);
$(this).addClass( "redborder" );
errcnt++;
}else{}
});
but none of these fix this issue.
Please advice.
I use princexml to generate PDF from html.
I have some graph images that are dynamic generated on-fly. When I generate PDF sometimes that images not load in PDF, some load.. I think it's related to timeload of images.
In my html I try to fix by adding:
<link rel="preload" as="image" href="{$fpimg}" />
or
#preloadedImages{
width: 0px;
height: 0px;
display: inline;
background-image: url({$fpimg});
background-image: url();
}
or
var errcnt = 0;
$("img").error(function () {
if(errcnt < 3){
src = $(this).attr("src");
$(this).attr("src", src);
$(this).addClass( "redborder" );
errcnt++;
}else{}
});
but none of these fix this issue.
Please advice.