Announcement

Collapse
No announcement yet.

Image in the header of a PDF Template

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

  • Image in the header of a PDF Template

    Hello.

    I need to print a multi-page PDF with product specifications.

    The product name and some basic information is repeated on all pages. One of the things that is repeated is our company logo.

    For marketing reasons ( form of the logo), that logo is different from the logo that is given in .../#Admin/userInterface. It is an image that was uploaded later.

    In theory this is simple. We go to the templates and define the fields we want to print. The fields that we want to be repeated in all the pages are defined in the header of the template.

    In the header we have included this image, with the following instruction

    <td rowspan="3" width="25%" align="center">
    <img src="?entryPoint=attachment&amp;id=5e53d764a0c5912 4c" style="width: 120px;">
    </td>

    Of course, the full details defines a table and a row

    The header is displayed perfectly on the first page. In the second and successive pages the image is missing. The rest of the fields appear perfect.

    It seems to me that it is well defined but evidently it is not working as I expect. Any suggestions on what I should look at or what I should change?

    Thanks for any advice

  • #2
    Use this:

    Code:
    <td rowspan="3" width="25%" align="center">
        <img src="{{file '5e53d764a0c5912'}}" style="width: 120px;">
    </td>
    see ref: https://docs.espocrm.com/user-guide/...to-pdf/#images
    CEO & Founder of Eblasoft.
    Professional EspoCRM development & extensions.

    Comment


    • #3
      You mean to use this:?

      {{imageTag imageFieldNameId width=50 height=50}}
      • imageFieldNameId is a name of image field, concatenated with Id
      • width and height can be omitted
      But in this case, it is a fixed image (the logo) that I need to call outside of the record. So I have no name for it (no imageFieldName)

      Anyway I used this

      <td rowspan="3" width="25%" align="center">
      {{imageTag "5e53d764a0c59124c" width=120}}
      </td>


      With that happens the same thing. The image appears just in the first page

      Comment


      • #4
        Try to arround the image with a div tag like this:

        <td width="25%" align="center">
        <div>
        {{imageTag "5e53d764a0c59124c" width=120}}
        </div>
        </td>

        CEO & Founder of Eblasoft.
        Professional EspoCRM development & extensions.

        Comment


        • #5
          Thank you very much for your help

          I did what you suggested. The result has been this:

          Running, it stays running for a long time and finally ends without generating anything.

          The bad thing is that now I can't correct the template code.

          That part of the code was in the header (Cabecera in Spanish).

          Now when I view the template, before editing, I see that the header is there as you can see in image1.




          Click image for larger version

Name:	Image1.png
Views:	419
Size:	86.7 KB
ID:	74456

          But as soon as I try to edit it, it seems to disappear and does not let me edit it. It is seen in image2.

          Click image for larger version

Name:	Image2.png
Views:	484
Size:	71.1 KB
ID:	74455

          There is nothing between the header tag (Cabecera in Spanish) and the body tag (Cuerpo in Spanish).

          Cannot access to the Header code. Trying to solve it, I duplicated the template and the duplicate has exactly the same problem.​​

          Comment


          • #6
            Apologies for the previous post

            I recovered the template (fortunately I had backup) and did the test again.

            This time I did not get the error described before. I must have typed something wrong and I got what was described.

            Repeated the process, the situation is the same: It shows the image in the first page but not in the rest of the pages

            Comment

            Working...
            X