PDF rendering restriction

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yberges
    Senior Member
    • Jul 2022
    • 174

    PDF rendering restriction

    hello i read pdf documentation its cool
    but we didn't have reference to pdf library generator ... and renedring is so strange lol (i now it a library limitation)
    exemple :
    i try to add a background in table price and text centered
    i do this code
    Code:
    tbody>
    <tr style="background:#cccccc;">
    <th width="5%" align="left" style="text-align: center; "><b>#</b></th>
    <th width="48%" align="left" style="text-align: center;"><b>Désignation</b></th>
    <th width="15%" align="left" style="text-align: center;"><b>Nombre de participant</b></th>
    
    <th width="16%" align="left" style="text-align: center;"><b>P.U HT</b></th>
    <th width="16%" style="text-align: center;"><b>Montant HT</b></th>
    </tr>​
    but background isn't rendered and texte is alway on left ...
    any recommandation ?
    thanks for you great CRM and very good support
  • rabii
    Active Community Member
    • Jun 2016
    • 1250

    #2
    Try this instead:

    Code:
    <table border="1">
    <tbody>
    <tr style="color: #fff; background: #cccccc;">
    <th width="5%" align="left" style="text-align: center; "><b>#</b></th>
    <th width="48%" align="left" style="text-align: center;"><b>Désignation</b></th>
    <th width="15%" align="left" style="text-align: center;"><b>Nombre de participant</b></th>
    <th width="16%" align="left" style="text-align: center;"><b>P.U HT</b></th>
    <th width="16%" style="text-align: center;"><b>Montant HT</b></th>
    </tr>
    </tbody>
    </table>
    Rabii
    Web Dev

    Comment

    • yberges
      Senior Member
      • Jul 2022
      • 174

      #3
      hello sorry i already have <table> <tbody> etc ...
      nothing more i known that pdf generation is limited (nightmare)

      Comment

      • rabii
        Active Community Member
        • Jun 2016
        • 1250

        #4
        it is better to build your template in a friendly html editor then copy code to pdf. try this one https://htmlcodeeditor.com/
        Rabii
        Web Dev

        Comment

        • yberges
          Senior Member
          • Jul 2022
          • 174

          #5
          my code i valid in html my question is more pdf interpretation (restriction)

          Comment

          • yuri
            Member
            • Mar 2014
            • 8442

            #6
            Espo uses TCPDF library. Its HTML support is very limited. We plan to add an additional engine in the future. Developers can implement any PDF engine in upgrade-safe way, unfortunately nobody implemented any yet AFAIK.
            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

            • yberges
              Senior Member
              • Jul 2022
              • 174

              #7
              yes did you have selected a new engine ? (for futur plan)

              Comment


              • yuri
                yuri commented
                Editing a comment
                Might be https://github.com/dompdf/dompdf

              • yuri
                yuri commented
                Editing a comment
                The most challenging part is to implement all additional features we have preserving compatibility. Like barcodes, QR-codes, custom tags.
            • yberges
              Senior Member
              • Jul 2022
              • 174

              #8
              yes i understand

              Comment

              • esforim
                Active Community Member
                • Jan 2020
                • 2204

                #9
                There is a TCPDF v2 in progress at the moment, but it been many months since they did an update. Look like the "Core" re-write is stuck in a long queue at the moment.

                How much of an improvement will v2 bring? We do not know yet.

                There was a few thread about changing PDF Engine or making it 'better', but it all internal and not publicly shown on the Forum so we have yet to find a proper solution. It is always good to see this topic get revive as there is more chance that it get look at.

                Looking at domPDF it look quite cool with feature and it still being update as well.
                Last edited by esforim; 12-12-2022, 02:01 AM.

                Comment

                • yberges
                  Senior Member
                  • Jul 2022
                  • 174

                  #10
                  Yes not seems ready for a long time

                  Comment

                  • yuri
                    Member
                    • Mar 2014
                    • 8442

                    #11
                    Dompdf support planned in v7.4 https://github.com/espocrm/espocrm/issues/2564
                    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
                      • 1603

                      #12
                      Will the new engine need all templates to be recoded?

                      Comment


                      • yuri
                        yuri commented
                        Editing a comment
                        If you switch to the new engine (globally in settings), there may be some differences in resulting PDFs. So you may need to make some fixes.
                    • esforim
                      Active Community Member
                      • Jan 2020
                      • 2204

                      #13
                      Is it possible to have both engine to use? Like two button or options?

                      Guess we wait till domPDF is added and we will see

                      Comment


                      • yuri
                        yuri commented
                        Editing a comment
                        Won't be possible for now. I think it will be reasonable to migrate to Dompdf for everyone as it seems that the Tcpdf lib has no future, it's already quite dated code-wise. Likely we will make it deprecated eventually.
                    • yberges
                      Senior Member
                      • Jul 2022
                      • 174

                      #14
                      great news

                      Comment

                      Working...