Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37673

Re: Image to pdf via plugingile.php

$
0
0
by Davo Smith.  

One option is to grab the contents of the file (via $file->get_contents()), then call base64_encode() on the contents and then output the image tag as:

<img src="@[base64 encoded file contents]" />

TCPDF uses the @ to indicate that the image content has been inlined into the tag.

If you aren't generating the image link yourself, then you'll probably need a regular expression to extract all the 'pluginfile.php' links (within img tags) and then extract the relevant details to get the stored_file object.


Viewing all articles
Browse latest Browse all 37673

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>