Announcement

Collapse
No announcement yet.

PDF Printing: QR Code with multiline text contains line breaks or similar html tags

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

  • PDF Printing: QR Code with multiline text contains line breaks or similar html tags

    Hi all,

    I have created a barcode field "myqrcode" in my custom entity "Invoice".
    The barcode field will contain payment information for easy payment.
    This kind of QR Codes consits of more than one line.
    I am assigning the value in the formula section of my entity. like $myqrcode='BCD\n001\nSCT\nmytext';
    The QR Code is rendered correctly in the Espo Frontend.

    When trying to use it also in the Print PDF, the multiline will be interpreted as html tag <br>.
    I am using the following syntax for pdf printing: {{barcodeImage myqrcode type='QRcode' width=60 height=60}}

    My Question:
    How can I force not to render html tags for multiline/line breaks or similar, so that the QR Code does not contain that?

    I know that for fields from type "texteditor" which can contain html tags from the wyswyg editor we can use three brackers "{{{ myfield }}}" to prevent printing html tags in pdf.
    Is there anything simialr for the bardcode syntax, maybe an attribute / property?

    I also tried to push the value of the qrcode field into any feild of type textbox, unfortunately we can only reference field from type barcode in the pdf syntax.

    Thank you for your help.

    Hint: I am using Dompdf with Espo 7.4.3.0

  • #2
    Hi all,

    after some more trial and error approaches, I was able to find a solution:
    Just extend the field name "myqrcode" with the suffix _RAW --> myqrcode_RAW

    {{barcodeImage myqrcode_RAW type='QRcode' width=60 height=60}}

    Now the line breaks will not be rendered when printing the barcode via PDF.

    Comment

    Working...
    X