Announcement

Collapse
No announcement yet.

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

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

  • 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

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

    Comment


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

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

      Comment


      • #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


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

          Comment


          • #6
            We don't consider TCPDF peculiarities as bugs.

            Comment


            • #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.

              Comment


              • #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


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

                  Comment


                  • #10
                    Please, don't provide links to the domo in bug reports. Its lifetime very short.

                    Comment


                    • #11
                      You're right. Thank you shalmaxb

                      Comment

                      Working...
                      X