CSS not rendering in Knp Snappy Bundle Image

22 Views Asked by At

I want to generate an image using a URL. Although the image is generating but seems the CSS is not rendering.

#[Route('/test', name: 'test')]
public function test(Image $knpSnappyImage)
{
    $filepath = $this->getParameter('snappy_image') . '/' . 'imagehd.jpg';
    $knpSnappyImage->setOption('height', 1080);
    $knpSnappyImage->setOption('width', 1440);
    $knpSnappyImage->setOption('quality', 100);
    $knpSnappyImage->setOption('enable-local-file-access', true);
    $knpSnappyImage->generate('http://www.example.com', $filepath);

    return new Response("Image successfully created in " . $filepath);
}

Is there any solution to this?

0

There are 0 best solutions below