I am having a problem. I am wanting to use html2canvas to print a PDF (generated by TCPDF) which has been embedded on a page.
Sorry for the very bad drawing, but the PDF needs to be embedded in the page like this.
Usually for putting a PDF on a page with TCPDF I just an iframe to include the url. But since html2canvas doesn't support printing iframes, that won't work. Using a $().load();
to try and load it into a div does not work, just creates a bunch of gibberish letters. I'm just wondering if anyone has any experience with this or knows how it might be possible.
Ultimately I'm trying to print the pdf without actually creating a PDF file
Sorry, can't comment yet. Do you want to embed a object like this?
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object
If so; Let tcpdf create your PDF as a file, ie with
$pdfname = 'name_my.pdf';
$pdf->Output(dirname(__FILE__).'/'.$pdfName, 'F');
and then
echo
'
<object type="application/pdf"
data="'.$pdfName.'"
width="250"
height="200">
</object>
';
If the error occurs:
Unable to create output file
Then maybe you struggle with permissions in the directory of your server.