Announcement

Collapse
No announcement yet.

PDF Template : Base 64 img

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

  • PDF Template : Base 64 img

    Hi there,

    I'm trying to display a base64 image in a Template but it seems that Tcpdf can't display them properly.
    I tried with 2 different base64 image like this one : https://jsfiddle.net/hpP45/
    But in either case it didn't work at all.​


    Is there any workarround or solution for this ?

    Regards,
    Firyo.

  • #2
    Hello Firyo
    have you tried something like this? https://stackoverflow.com/a/54520065
    Of course do it outside of Espo, properly convert base64 with image as they showed in post and then paste it into pdf template.
    Basically the best option to add image to EspoCRM pdf template is to use images. You can read more in documentation Printing to PDF - EspoCRM Documentation

    Comment


    • #3
      Originally posted by emillod View Post
      Hello Firyo
      have you tried something like this? https://stackoverflow.com/a/54520065
      Of course do it outside of Espo, properly convert base64 with image as they showed in post and then paste it into pdf template.
      Basically the best option to add image to EspoCRM pdf template is to use images. You can read more in documentation Printing to PDF - EspoCRM Documentation
      Hi there,

      First of all thanks for you answer.

      If I may add a little more of context :
      I have a "text" field inside my "customEntity" and inside it we store a base64 image.
      And I want to display this field as an image into my "Template" (I tried with DomPDF in 8.0.2 and it's working but I'm currently running espo 7.1.11).

      Talking about that Stack Overflow post, I already did read it but I wasn't really paying attention to it tbh 😓.
      This time I was focused and I see how to apply it to EspoCRM.

      2 options :
      - Create a nonStorable field inside my "customEntity"
      - Create a template helper

      Thanks a lot for your answer again 👍

      Regards,
      Firyo.
      Last edited by Firyo; 09-29-2023, 02:20 PM.

      Comment


      • #4
        Originally posted by Firyo View Post
        (I tried with DomPDF in 8.0.2 and it's working but I'm currently running espo 7.1.11).
        Tcpdf had been a horrible limitation of Espo but thankfully Dompdf came along and it is a much better option to display images.

        I would suggest that instead of wasting time trying, without sucess, to "fix" Tcpdf limitations (like I did it trying to make Tcpdf render SVG images), that you upgrade to at least Espo 7.4.3 which has the ability to use Dompdf.

        Regards

        Comment


        • #5
          Originally posted by telecastg View Post

          Tcpdf had been a horrible limitation of Espo but thankfully Dompdf came along and it is a much better option to display images.

          I would suggest that instead of wasting time trying, without sucess, to "fix" Tcpdf limitations (like I did it trying to make Tcpdf render SVG images), that you upgrade to at least Espo 7.4.3 which has the ability to use Dompdf.

          Regards
          Hi,

          Yeah Tcpdf is a bit of a nightmare to work with.

          I will upgrade my EspoCRM for the latest version in early november. So for now I will have to keep my EspoCRM to the 7.1.11 version.
          So I will apply one of the two methods I mentionned here.

          Regards,
          Firyo.

          Comment

          Working...
          X