Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP HTML Word Doc not showing image generated via URL
    primarykey
    data
    text
    <p>I have a php script that generates a word document by creating it in HTML and outputting it to <code>.doc</code> when attaching static images from my website, the images load fine in Microsoft Word 03 and 2010. However when attempting to use a URL to generate an image (by parsing it a parameter) the image doesn't seem to load. </p> <pre><code>header('Content-type: application/ms-word'); header('Content-Disposition: attachement;filename="report.doc"'); header('Content-Transfer-Encoding: binary'); print($output); </code></pre> <p>Heres what I'm trying to do, I have a URL (website.com/signature.php?form=XXXX) where <code>XXX</code> is the form ID. The signature.php takes in the ID nunmber, locates the JSON stored on the server and generates an image from the JSON file, using this jquery plugin <a href="http://thomasjbradley.ca/lab/signature-to-image/" rel="nofollow">http://thomasjbradley.ca/lab/signature-to-image/</a></p> <p>The signature/image converts fine and I see it when I test it against some examples, however when opening up the document in word, it doesn't show.</p> <pre><code>&lt;img style="display: block;" alt = "" width="200" height="74" src = "http://myWebsite.net/signature.php?form=' . $results[$i]['id'] . '" /&gt; </code></pre> <p>That's what I have for my HTML.</p> <p>EDIT:</p> <p>In my signature.php I have the following:</p> <pre><code> require("DB/DBConnection.php"); require("signature-to-image.php"); $formID = $_REQUEST['form']; $dbh = DBConnection::connection(); $sql = "SELECT signature FROM forms where id = ?"; $stmt = $dbh-&gt;prepare($sql); $stmt-&gt;bindValue(1, $formID, PDO::PARAM_STR); $stmt-&gt;execute(); $result = $stmt-&gt;fetch(); if ($result != null) { $img = sigJsonToImage($result['signature']); header('Content-Type: image/jpeg'); imagejpeg($img); imagedestroy($img); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload