KnpSnappyBundle
KnpSnappyBundle copied to clipboard
Image randomly displayed in PROD when pdf is generated
Hello,
I have a strange issue, when I run the generation of PDF in dev, all images are fines but when I run the generation in production, sometime image si displayed, sometime not... with the same URL path :
<img class="img-puce" src="{{ absolute_url(asset('images/logo.png')) }}" alt="MyLogo" width="100px" height="78px">
in the HTML genereted, the images are always ok but the issue looks to be after the PDF conversion...
-->
Do you have any idea how to debug this?
Smyfony 5.4 // bundle 1.9 (all is up to date)
My functions:
public function renderHtml(Subscription $subscription, string $locale = 'fr')
{
return $this->twig->render('subscription/pdf.html.twig', [
'subscription' => $subscription,
'locale' => $locale,
]);
}
public function createPdf(Subscription $subscription, string $locale = 'fr')
{
$html = $this->renderHtml($subscription, $locale);
$options_pdf = [
'encoding' => 'utf-8',
];
try {
$file_pdf = $this->pdf->getOutputFromHtml($html, $options_pdf);
} catch (\Exception $exception) {
$this->logger->error($exception->getMessage());
throw new HttpException(400, 'Error with the generation of pdf, check log API to more information.');
}
return $file_pdf;
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello, no idea for this issue?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.