Announcement

Collapse
No announcement yet.

How To Display QR Code In PDF Templates

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How To Display QR Code In PDF Templates

    UPDATE:
    please check this link https://www.espocrm.com/documentatio...-barcode-field before read this post, its new added feature, thanks for espocrm team.

    I faced this request today and found a very easy trick to achieve it, it is simple but may someone find it useful,

    There are several services that easily return QR image by url like this,

    In the following example I am displaying both of the entity's id and name separated by comma

    HTML Code:
    <img src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data={{id}},{{name}}" height="150px">
    NOTE: you must switch the editor to the code view mode and then paste the above script

    Click image for larger version  Name:	Screen Shot 2019-06-22 at 7.07.14 AM.png Views:	30 Size:	39.5 KB ID:	49397
    Last edited by eymen-elkum; 03-28-2020, 09:31 AM. Reason: added link to new added feature by espocrm regarding the barcode
    CEO of Eblasoft
    EspoCRM Expert since 2014
    Full Stack Web Developer since 2008
    Creator of Numerous Successful Extensions & Projects​

  • #2
    That's perfect - QR code and barcode implementations have been on my list for a while. This ticks at least one of them off.

    Have you figured out how you can get this to work in a Template for PDF printing?

    Comment


    • eymen-elkum
      eymen-elkum commented
      Editing a comment
      it is already printable, as any other image, just paste the html script in the body of the pdf template, but make sure you switched to the code view mode

  • #3
    Originally posted by ayman.alkom View Post
    I faced this request today and found a very easy trick to achieve it, it is simple but may someone find it useful,

    There are several services that easily return QR image by url like this,

    In the following example I am displaying both of the entity's id and name separated by comma

    HTML Code:
    <img src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data={{id}},{{name}}" height="150px">
    NOTE: you must switch the editor to the code view mode and then paste the above script

    Click image for larger version  Name:	Screen Shot 2019-06-22 at 7.07.14 AM.png Views:	24 Size:	39.5 KB ID:	49397
    Hi Ayman,

    Is it possible to put the following QR code into Email Template?

    barcodeImage=string\concatenate("https://YOUR_WEBSITE8URL/#YourEntity/view/", id);

    This formula generates a barcode for the address of a record and the barcode can be displayed directly in the record's detailview.

    It can also be displayed in PDF Template with  {{barcodeImage qrCode type='QRcode'}}

    Now I want to display the same barcode in emails (Email template) but do not know how to make it. Is this possible?

    Thanks.
    Last edited by chrisjiang; 03-28-2020, 02:02 AM.

    Comment


    • chrisjiang
      chrisjiang commented
      Editing a comment
      That is about PDF template. What I want o do is to make the barcode image into Email Template. Is there a way to do that?

    • eymen-elkum
      eymen-elkum commented
      Editing a comment
      I have not tried with email templates, not sure if the barcode field can work, but have you tried the same trick with Email Templates ?

    • chrisjiang
      chrisjiang commented
      Editing a comment
      I tried but it does not work.

  • #4
    Repeated comment

    Comment

    Working...
    X