Announcement

Collapse
No announcement yet.

Images in pdf templates not working with latest update

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

  • Images in pdf templates not working with latest update

    Hi, I updated to EspoCRM 8.1 and Sales Pack 2.1.4.
    My templates are using a logo: <img src="/client/img/2x4_Logo_Large_RGB.png" style="width: 80px;height:80px;">

    With the latest version, the pdf does not print the logo anymore, although I can see the logo in the pdf editor preview. So the logo is there.

    When I add a new logo and use the upload button, it does use the new logo. The html for that is: <img src="?entryPoint=attachment&amp;id=65c4b099af5398d ef" style="width: 80px;height:80px;">

    I did not change anything to my /client/img directory, so I am not sure why this is a problem.

    Thanks,

    Bernhard

  • #2
    Did you configure the correct pdf engine? Are your templates made with TCPDF? Because by default in espoCRM now DomPDF is configured.

    Comment


    • Bernhard
      Bernhard commented
      Editing a comment
      Thanks for the info. My List only contains DomPDF, so I cannot switch back to TCPDF ...

  • #3
    Originally posted by Bernhard View Post
    Hi, I updated to EspoCRM 8.1 and Sales Pack 2.1.4.
    My templates are using a logo: <img src="/client/img/2x4_Logo_Large_RGB.png" style="width: 80px;height:80px;">

    With the latest version, the pdf does not print the logo anymore, although I can see the logo in the pdf editor preview. So the logo is there.

    When I add a new logo and use the upload button, it does use the new logo. The html for that is: <img src="?entryPoint=attachment&amp;id=65c4b099af5398d ef" style="width: 80px;height:80px;">

    I did not change anything to my /client/img directory, so I am not sure why this is a problem.

    Thanks,

    Bernhard
    Yes the system doesn't read this src="/client/img/2x4_Logo_Large_RGB.png" it won't work, what you can do is to find the id of 2x4_Logo_Large_RGB.png in the attachment and then use the image endpoint to access that logo. same as when you upload. Because the endpoint add the full path to access those images.
    Rabii
    Web Dev | Freelancer

    Comment


    • Bernhard
      Bernhard commented
      Editing a comment
      Thanks, Even a fully qualified correct url suing https://.... does not work.

  • #4
    With Dompdf engine, this ability it disabled, as it's not secure to be able to refer internal files.

    If you need to an image, you can just upload it in an PDF template.

    Or you can switch back to the Tcpdf. See the release notes of v8.1. https://github.com/espocrm/espocrm/issues/2910

    Comment


    • #5
      Thanks a lot. I use the Upload Button now, and this works for me. Thanks again for your support.

      Comment


      • #6
        Hello all,

        i have a similar Problem with an image in pdf templates, maybe someone could check out the code section in my already created Topic over here and give me a hint whats wrong:

        Hallo zusammen, mein Ziel ist es ein Logo (welches als Wasserzeichen designed worden ist) mittig auf allen Seiten eines Angebots oder einer Rechnung zu platzieren. Im User-Guide ( https://docs.espocrm.com/user-guide/printing-to-pdf/ ) heißt es &quot;Dompdf has better CSS support&quot; - hört sich gut an, bleibt also. Es ist


        In the Preview the Image is centered in the middle of the template, if i use the function "print to pdf" the image is not there.

        many many thanks in advance!

        Comment

        Working...
        X