Announcement

Collapse
No announcement yet.

Bug with PDF margins

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

  • Bug with PDF margins

    After some time trying to figure out why my PDF reports don't adhere to the "right margin" setting in Scriptcase, I discovered what appears to be a bug in the generated code.

    If your PDF also has issues with setting the right margin, try this fix.

    1. Open the file ...._grid.class.php

    2. Find the function - Pdf_init()

    3. Add the following line

    // SetMargins($left,$top,$right,$bottom)
    $this->Pdf->SetMargins(0, 0, 25, 0);



    So mine now looks like this:

    function Pdf_init()
    {
    if ($_SESSION['scriptcase']['reg_conf']['css_dir'] == "RTL")
    {
    $this->Pdf->setRTL(true);
    }
    $this->Pdf->setHeaderMargin(0);
    $this->Pdf->setFooterMargin(0);
    $this->Pdf->setCellMargins($left = 0, $top = 0, $right = 75, $bottom = 0);
    $this->Pdf->SetAutoPageBreak(true, 0);
    $this->Pdf->SetMargins(0, 0, 25, 0);
Working...
X