Displaying QR Code to a PDF stream, Laravel 4.2
<p>Hello im trying to display a QR Code(generated by <a href="https://github.com/SimpleSoftwareIO/simple-qrcode" rel="nofollow noreferrer">https://github.com/SimpleSoftwareIO/simple-qrcode</a>) on to a pdf file(generated by <a href="https://github.com/barryvdh/laravel-dompdf/tree/0.4" rel="nofollow noreferrer">https://github.com/barryvdh/laravel-dompdf/tree/0.4</a>)</p>
<p>here are my codes:</p>
<p>routes.php</p>
<blockquote>
<p>$pdf = PDF::loadView('emails.applicationform');</p>
<p>return $pdf-&gt;stream();</p>
</blockquote>
<p>emails/applicationformpdf.blade.php</p>
<blockquote>
<p>{{QrCode::size(200)-&gt;generate('hello')}}</p>
</blockquote>
<p>P.S. I can confirm that i can out text and certain images to the pdf stream. i have tried to use</p>
<blockquote>
<p>$pdf-&gt;download('something.pdf');</p>
</blockquote>
<p>as well in the routes.php file but with no luck. Does anyone know a way to work around this?</p>
<p>EDIT:
There are three formats available for the qr code but only svg renders properly. The other two formats outputs the following.
PNG:</p>
<pre><code>�PNG  IHDR��&quot;:9�JIDATx���A��0@��0�?r��x�B�Y�S�N�6�|��?������}&lt;��H���H���H���H���H���H���H���H���H���H���H���H���H���H���H���H���H���H�����^;S9��z��w���ܻ:7�bl�&quot;!,�&quot;!,�&quot;q�Tx�M+#SتIm�.��{ʊEBX$�EBX$�Eb�Tx57�ܹ6�8w=��� +  a�  a����;�}�s��`V,�&quot;!,�&quot;!,�&gt;��w�^�cX�H���H���H�8�?Ou��;��Y�H���H���H�� �����U���|�c&lt;���KX$�EBX$�E��1�Ss��E�X$�EBX$�EBX$N|^��_�uO�{�hw�Y�H���H���H��+�s�n�s�i��X$�EBX$�EBX$�O�W�߈��ʽ;���j�&quot;!,�&quot;!,�&quot;�����;��&gt;q��&amp;ⅎ� �AX$�EBX$�E�Ľ���]7'�z�G�b�   a� a��ԩp��{�����N�V,�&quot;!,�&quot;!,'�A�Y5�}7u�]s{��g�++    a�  a����+������l{�|7ǊEBX$�EBX$�Eb�Tx���#��=?q��ӥ���H���H�ĉS��V�Z3�{�Ł&gt;��9��H���H�ķO�w�A��s&gt;b��b�   a�  a�8q*����w���kn��{MʊEBX$�EBX$�Eb�T�}W�?#����w�����O�1�EBX$�EBX$��y�D�X$�EBX$�EBX$�EBX$�EBX$�EBX$�EBX$�EBX$�EBX$�EBX$�EBX$�EBX$�EBX$�EBX$�EBX$�EBX$�EBX$�EBX$�E���w�D�RIEND�B`�
</code></pre>
<p>EPS:</p>
<pre><code>%!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: 0 0 200 200 /F { rectfill } def 1.000000 setgray 0 0 200 200 F 0.000000 setgray 37 163 6 6 F 43 163 6 6 F 49 163 6 6 F 55 163 6 6 F 61 163 6 6 F 67 163 6 6 F 73 163 6 6 F 91 163 6 6 F 103 163 6 6 F 109 163 6 6 F 121 163 6 6 F 127 163 6 6 F 133 163 6 6 F 139 163 6 6 F 145 163 6 6 F 151 163 6 6 F 157 163 6 6 F 37 157 6 6 F 73 157 6 6 F 85 157 6 6 F 91 157 6 6 F 103 157 6 6 F 121 157 6 6 F 157 157 6 6 F 37 151 6 6 F 49 151 6 6 F 55 151 6 6 F 61 151 6 6 F 73 151 6 6 F 85 151 6 6 F 91 151 6 6 F 109 151 6 6 F 121 151 6 6 F 133 151 6 6 F 139 151 6 6 F 145 151 6 6 F 157 151 6 6 F 37 145 6 6 F 49 145 6 6 F 55 145 6 6 F 61 145 6 6 F 73 145 6 6 F 91 145 6 6 F 103 145 6 6 F 121 145 6 6 F 133 145 6 6 F 139 145 6 6 F 145 145 6 6 F 157 145 6 6 F 37 139 6 6 F 49 139 6 6 F 55 139 6 6 F 61 139 6 6 F 73 139 6 6 F 85 139 6 6 F 109 139 6 6 F 121 139 6 6 F 133 139 6 6 F 139 139 6 6 F 145 139 6 6 F 157 139 6 6 F 37 133 6 6 F 73 133 6 6 F 85 133 6 6 F 103 133 6 6 F 109 133 6 6 F 121 133 6 6 F 157 133 6 6 F 37 127 6 6 F 43 127 6 6 F 49 127 6 6 F 55 127 6 6 F 61 127 6 6 F 67 127 6 6 F 73 127 6 6 F 85 127 6 6 F 97 127 6 6 F 109 127 6 6 F 121 127 6 6 F 127 127 6 6 F 133 127 6 6 F 139 127 6 6 F 145 127 6 6 F 151 127 6 6 F 157 127 6 6 F 85 121 6 6 F 91 121 6 6 F 97 121 6 6 F 103 121 6 6 F 109 121 6 6 F 37 115 6 6 F 43 115 6 6 F 55 115 6 6 F 73 115 6 6 F 79 115 6 6 F 91 115 6 6 F 97 115 6 6 F 121 115 6 6 F 127 115 6 6 F 133 115 6 6 F 145 115 6 6 F 151 115 6 6 F 43 109 6 6 F 49 109 6 6 F 55 109 6 6 F 61 109 6 6 F 67 109 6 6 F 79 109 6 6 F 85 109 6 6 F 91 109 6 6 F 121 109 6 6 F 151 109 6 6 F 157 109 6 6 F 49 103 6 6 F 55 103 6 6 F 67 103 6 6 F 73 103 6 6 F 79 103 6 6 F 85 103 6 6 F 97 103 6 6 F 109 103 6 6 F 115 103 6 6 F 139 103 6 6 F 145 103 6 6 F 157 103 6 6 F 55 97 6 6 F 67 97 6 6 F 85 97 6 6 F 103 97 6 6 F 139 97 6 6 F 151 97 6 6 F 157 97 6 6 F 61 91 6 6 F 73 91 6 6 F 79 91 6 6 F 91 91 6 6 F 97 91 6 6 F 109 91 6 6 F 121 91 6 6 F 133 91 6 6 F 85 85 6 6 F 91 85 6 6 F 97 85 6 6 F 103 85 6 6 F 127 85 6 6 F 133 85 6 6 F 145 85 6 6 F 157 85 6 6 F 37 79 6 6 F 43 79 6 6 F 49 79 6 6 F 55 79 6 6 F 61 79 6 6 F 67 79 6 6 F 73 79 6 6 F 85 79 6 6 F 91 79 6 6 F 97 79 6 6 F 115 79 6 6 F 127 79 6 6 F 139 79 6 6 F 145 79 6 6 F 151 79 6 6 F 37 73 6 6 F 73 73 6 6 F 91 73 6 6 F 97 73 6 6 F 103 73 6 6 F 109 73 6 6 F 115 73 6 6 F 127 73 6 6 F 133 73 6 6 F 37 67 6 6 F 49 67 6 6 F 55 67 6 6 F 61 67 6 6 F 73 67 6 6 F 91 67 6 6 F 103 67 6 6 F 121 67 6 6 F 127 67 6 6 F 133 67 6 6 F 157 67 6 6 F 37 61 6 6 F 49 61 6 6 F 55 61 6 6 F 61 61 6 6 F 73 61 6 6 F 85 61 6 6 F 97 61 6 6 F 103 61 6 6 F 127 61 6 6 F 139 61 6 6 F 145 61 6 6 F 151 61 6 6 F 157 61 6 6 F 37 55 6 6 F 49 55 6 6 F 55 55 6 6 F 61 55 6 6 F 73 55 6 6 F 91 55 6 6 F 97 55 6 6 F 109 55 6 6 F 133 55 6 6 F 145 55 6 6 F 157 55 6 6 F 37 49 6 6 F 73 49 6 6 F 85 49 6 6 F 91 49 6 6 F 97 49 6 6 F 115 49 6 6 F 121 49 6 6 F 37 43 6 6 F 43 43 6 6 F 49 43 6 6 F 55 43 6 6 F 61 43 6 6 F 67 43 6 6 F 73 43 6 6 F 85 43 6 6 F 97 43 6 6 F 103 43 6 6 F 109 43 6 6 F 127 43 6 6 F 139 43 6 6 F 151 43 6 6 F
</code></pre>
<p>I have tried putting the png in an img tag and put the qr code as the source but with no luck.</p>