Bug in PDF footer when i'm using pageNumber and totalPageNumber tags

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emillod
    Active Community Member
    • Apr 2017
    • 1405

    Bug in PDF footer when i'm using pageNumber and totalPageNumber tags

    Hello Guys,
    i think that i found a bug. I've created new PDF template on demo.espocrm.com which contain footer with Footer position set to 10. Then i switched Footer editor to code and I've pasted this code:
    HTML Code:
    <table width="100%" style="border:none; font-size:8px;">
    <tbody><tr>
    <td width="15%" style="text-align: left;"><strong>Test Inc.</strong><br>TAX ID: 1234567890</td>
    <td width="45%" style="text-align: left;">e-mail: contact@domain.com | phone 123 456 789<br>Correspondence address: ul. Test 13/2, 02-123 Warsaw</td>
    <td width="13%" style="text-align: left;background-color:red">Page <br>{pageNumber} from {totalPageNumber}</td>
    <td width="24%" style="text-align: left;">Generated at {{now}}<br>by Johne Doe</td>
    </tr></tbody></table>
    I saved template and opened PDF template generated based on Account (if demo will not refresh till now, you can use this link) https://demo.eu.espocrm.com/?entryPoint=pdf&entityType=Account&entityId=5f5f1f cec41c41354&templateId=638cc76a928c298de

    And that's a result:
    Click image for larger version  Name:	image.png Views:	0 Size:	19.1 KB ID:	85926
    I've changed background color of problematic cell to red to show you how big is this cell and it should fill only two lines, instead of three. Even if i remove <br> to get everything into one line, i can't:
    Click image for larger version  Name:	image.png Views:	0 Size:	18.0 KB ID:	85927

    It's also look weird if i switch alignment to right:
    Click image for larger version  Name:	image.png Views:	0 Size:	17.1 KB ID:	85928

    SO:
    cell is big enough to show whole cell in one line, but it doesn't, probably because of tags? If i remove tags and replace them with Page 1 from 1, it looks normal:
    Click image for larger version  Name:	image.png Views:	0 Size:	16.4 KB ID:	85929
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1602

    #2
    Maybe it is because the sum of your cell % is not 100 %, but the table itself is.

    Comment

    • emillod
      Active Community Member
      • Apr 2017
      • 1405

      #3
      shalmaxb
      no, it's not related:
      Click image for larger version

Name:	image.png
Views:	1346
Size:	18.4 KB
ID:	85932

      Comment

      • shalmaxb
        Senior Member
        • Mar 2015
        • 1602

        #4
        from my expierience, it could be the <br> before the page number or even the space before that <br> in the code. The PDF editor behaves very strange sometimes.

        Comment

        • emillod
          Active Community Member
          • Apr 2017
          • 1405

          #5
          shalmaxb thank you for your response.
          If you have time, you can play with it

          Comment

          • yuri
            Member
            • Mar 2014
            • 8438

            #6
            We don't consider TCPDF peculiarities as bugs.
            If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

            Comment

            • yuri
              Member
              • Mar 2014
              • 8438

              #7
              There are millions of possible issues when PDF is generates with TCPDF. If all those will be reported we wouldn't be able to do real things but only fixing unfixable.
              Last edited by yuri; 12-04-2022, 04:51 PM.
              If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

              Comment

              • shalmaxb
                Senior Member
                • Mar 2015
                • 1602

                #8
                This works:

                Code:
                <table width="100%" style="border:none; font-size:8px;">
                <tbody><tr>
                <td width="15%" style="text-align: left;"><strong>Test Inc.</strong><br>TAX ID: 1234567890</td>
                <td width="40%" style="text-align: left;">e-mail: contact@domain.com | phone 123 456 789<br>Correspondence address: ul. Test 13/2, 02-123 Warsaw</td>
                <td width="18%" style="text-align: left;background-color:red">Page <br>{pageNumber} from {totalPageNumber}</td>
                <td width="24%" style="text-align: left;">Generated at {{now}}<br>by Johne Doe</td>
                </tr></tbody></table>
                second <td> 5% less. Even if TCPDF uses HTML I guess the parser is not programmed correctly. ​
                Last edited by shalmaxb; 12-04-2022, 04:53 PM.

                Comment

                • emillod
                  Active Community Member
                  • Apr 2017
                  • 1405

                  #9
                  Okay, if you can't fix it - no problem. Wanted to report just in case

                  Comment

                  • yuri
                    Member
                    • Mar 2014
                    • 8438

                    #10
                    Please, don't provide links to the domo in bug reports. Its lifetime very short.
                    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                    Comment

                    • emillod
                      Active Community Member
                      • Apr 2017
                      • 1405

                      #11
                      You're right. Thank you shalmaxb

                      Comment

                      Working...