So I've installed mPDF 8.1 to use with my CodeIgniter 4.
Got it working with opening a file in the browser.
Got it working with creating a file on the server.
Got it working with creating an attachment in an email.
But when I try to force download the created PDF using:
Code:
$mpdf->Output('filename.pdf', \Mpdf\Output\Destination::DOWNLOAD);
or
Code:
$mpdf->Output('filename.pdf', 'D');
I get a broken PDF that cannot be opened.
I used another program to see what was in the PDF and I see this:
Code:
<script type="text/javascript" id="debugbar_loader" data-time="1652299385" src="https://local.mywebsite.com/?debugbar"></script><script type="text/javascript" id="debugbar_dynamic_script"></script><style type="text/css" id="debugbar_dynamic_style"></style><script class="kint-rich-script">void 0===window.kintShared&&(window.kintShared=function(){"use strict";var e={dedupe:function(e,n){return[].forEach.call(document.querySelectorAll(e),function(e){e!==(n=!n||!n.ownerDocument.contains(n)?e:n)&&e.parentNode.removeChild(e)}),n},runOnce:function(e){"complete"===document.readyState?e():window.addEventListener("load",e)}};return window.addEventListener("click",function(e){var n;e.target.classList.contains("kint-ide-link")&&((n=new XMLHttpRequest).open("GET",e.target.href),n.send(null),e.preventDefault())}),e}())...
The code is much longer than that, but I think you get the idea.
Any clue as to what I'm doing wrong?
Thank you for any help!
-max