Announcement

Collapse
No announcement yet.

PDF rendering restriction

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

  • 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

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


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

      Comment


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


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

          Comment


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

            Comment


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

            • #8
              yes i understand

              Comment


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


                • #10
                  Yes not seems ready for a long time

                  Comment


                  • #11
                    Dompdf support planned in v7.4 https://github.com/espocrm/espocrm/issues/2564

                    Comment


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

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

                    • #14
                      great news

                      Comment

                      Working...
                      X