Jump to content

Add QR code to PDF template invoicepdf.tpl


Evgeny

Recommended Posts

Hi,

I have module bankinvoice and it generate qr code for banks. I want to add QR code picture to PDF template in file invoicepdf.tpl

I add all php code at the begin of file invoicepdf.tpl

... code .. code... 

$qrcode = base64_encode($contents);

in callback php file i use this string to show it

<img style="width: 35mm; height: 35mm;" src="data:image/png;base64, <? echo $qrcode; ?>" />

and it show qr code.

Return to file invoicepdf.tpl

I try this 

$pdf->writeHTML($qrcode, true, false, false, false, '');

and it show content in base64 result: BxCry.. ...sria7=

It's tell me that inserted code work good and i try to show it as image

$paymethhtml = '
<img style="width: 35mm; height: 35mm;" src="data:image/png;base64,
'.$qrcode.' />';

$pdf->writeHTML($paymethhtml, true, false, false, false, '');

but it not add QR (PDF generated as base, i think that i make something wrong. Please help to execute this string: 

<img style="width: 35mm; height: 35mm;" src="data:image/png;base64, <? echo $qrcode; ?>" />

in file invoicepdf.tpl correctly to show QR in PDF.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated