1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Problem with css for custom PDF-template that include calculations.

Discussion in 'Professional Support' started by blue-mouse, Jan 28, 2016.

Thread Status:
Not open for further replies.
  1. blue-mouse

    blue-mouse Member

    Level: Community
    Hi,
    I have my own Front-end-template for list:
    /com_fabrik/views/list/tmpl/default-2015-12-14-table-zlicz-pakiety-pdf1
    this works as i need

    I created also small modification of this template:
    /com_fabrik/views/list/tmpl/default-2015-12-14-table-zlicz-pakiety-pdf1-printout
    that i use as PDF-template

    I have problem for lines with fabrik calculations, that are in default.php
    one sample of this code is:
    PHP:
    <?php  $j=0;
                            foreach ($this->calculations as $cal) {
    if($j>=3 and $j<= 7)  {
                                     echo '<tr class="fabrik_calculations fab1_danka" >';
                                            echo "<td>";
                                            echo array_key_exists($groupedby, $cal->grouped) ? $cal->grouped[$groupedby] : $cal->calc;
                                            echo "</td>";
                                            echo  "</tr>";
    }
    $j++;
    }
    echo " <div class='podkr1' style='margin-top: -7px; margin-bottom: -13px; text-align:right;'>  </div>";

     
    This generates lines for device-pieces called:
    Pakiet przetwornika
    ...
    Pakiet Backplane
    as you can see on screenshoots.

    I use custom_css.php
    and css stylling for those calculations:
    HTML:
    .fabrikForm  dt, .fabrikForm dd.splittotal  {
    clear:left;
      width:282px;
    font-weight: bold !important;
    text-decoration: underline !important;
    color: red !important;
    text-align: left;
    padding: 3px;
    margin-bottom: -2px;
    float:left;
    }

    .fabrikForm dd {
    /* dankam  width:350px; */
    /*  width:475px; */
      width: 100%;
      color: red !important;
      font-weight: bold;
      padding: 0px;
      margin-top: -60px;
    /* dankam testy tu sa pogrubione ilosci w kolorze czerwonym  margin-left: -50px; */
    }

    .fabrikForm   dd span.calclabel {
      color: blue !important;
      font-weight: normal !important;
    }

    .fabrikForm  dd.splittotal {
    font-weight: normal !important;
    font-style: italic;
    }

    .fabrikForm  td {
    margin-top: -60px !important;
    }

    .fab1_danka
    {
      text-align: right;
    }

    .fab1_danka .calclabel {
    float: left !important;
    text-align: left !important;

    }
     
    This what works nice for list-view, doesn't work for PDF template.

    I need:
    (calclabel), color:blue ----> on the left
    (values=numbers), color:red ---->on the right

    Have no idea how to do this.

    Please help with any advice.
     

    Attached Files:

  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I really can't help. As you now DOMPDF is a 3rd party library, and we just provide a "best effort". We hand the same HTML and CSS we display in the PDF debug view to DOMPDF. Any issues with formatting after we hand off to DOMPDF are out of our control.

    When did you last update the DOMPDF library, btw? As Troester mentioned, there was an update to DOMPDF a couple of years ago which improved it greatly.

    -- hugh
     
  3. blue-mouse

    blue-mouse Member

    Level: Community
    I have Git Hub version 01-07-2015 (01 July 2015) 3.09 for Joomla 2.5.
    I am not sure if DOMPDF library is actualized (automatically) together with git hub actualization?
     
  4. troester

    troester Well-Known Member Staff Member

    Level: Community
  5. blue-mouse

    blue-mouse Member

    Level: Community
    Is domPDF can't handle also text-align: left; or text-align: right; ?

    in that case all what i can do is:
    PHP:
    fabrikForm   dd span.calclabel {
      color: blue !important;
      font-weight: normal !important;  
      margin-right: 250px !important;
      text-align: left !important;
    }
     
    works only:
    margin-right: 250px !important;

    And i get this what is on screenshoot.
     

    Attached Files:

  6. troester

    troester Well-Known Member Staff Member

    Level: Community
    blue-mouse likes this.
  7. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Troester, was it you who was playing around with wkhtmlpdf a while back?

    Sent from my Nexus 7 using Tapatalk
     
  8. blue-mouse

    blue-mouse Member

    Level: Community
    Troester:
    Now, i have in my custom_css.php code:
    PHP:

    .fabrikForm   dd span.calclabel {
      color: black !important;
      font-weight: normal !important;
    text-align: left !important;
    display:inline-block;
    left:100%;
    width:95%;
    margin-left: -38px;
    }
     
    And all is printed on my PDF like i need.
    Many thanks!
     

    Attached Files:

    cheesegrits likes this.
  9. blue-mouse

    blue-mouse Member

    Level: Community
    Thanks, again.
    SOLVED
     
Thread Status:
Not open for further replies.

Share This Page