Hello
Cake ver: 4
Plugin: GitHub - FriendsOfCake/CakePdf: CakePHP plugin for creating and/or rendering PDFs, supporting several popular PDF engines.
I tried to create a PDF using DOMPDF with the CakePDF plugin. Everything works very well except for the QR code. The QR code is rendered on the HTML page; however, the QR is not printed in the PDF. I read somewhere that DOMPDF does not support Javascript.
Can anybody assist me on this matter? Thank you. I tried to download the QR and attach it as img but I don’t know how to download it to the targeted folder.
<div id="qr"></div>
<script type="text/javascript">
const qrCode = new QRCodeStyling({
width: 130,
height: 130,
margin: 0,
data: "<?php echo $this->request->getUri(); ?>",
dotsOptions: {
type: "dots"
},
cornersSquareOptions: {
type: "dots",
color: "#007bff",
},
cornersDotOptions: {
type: "dots"
},
imageOptions: {
crossOrigin: "anonymous",
margin: 20
}
});
qrCode.append(document.getElementById("qr"));
//qrCode.download({ name: "qr", extension: "png" });
</script>