Ignore:
Timestamp:
Feb 18, 2021, 1:59:28 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Improved generation of contracts.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/Pdf.php

    r901 r902  
    44{
    55  public bool $Checked = false;
     6  public string $BorderTop = '';
     7  public string $BorderLeft = '';
     8  public string $BorderRight = '';
     9  public string $BorderBottom = '';
     10  public int $FontSize = 0;
     11  public string $OutputFormat = 'pdf';
     12  public string $Charset = '8859-2';
    613
    714  function GenerateHTML(): string
     
    2431      } else throw new Exception('htmldoc is not installed.');
    2532    }
     33    $Parameters = '--no-numbered --footer . --webpage --no-embedfonts --charset '.$this->Charset.' -t '.$this->OutputFormat;
     34    if ($this->FontSize > 0) $Parameters .= ' --fontsize '.$this->FontSize;
     35    if ($this->BorderLeft != '') $Parameters .= ' --left '.$this->BorderLeft;
     36    if ($this->BorderTop != '') $Parameters .= ' --top '.$this->BorderTop;
     37    if ($this->BorderRight != '') $Parameters .= ' --right '.$this->BorderRight;
     38    if ($this->BorderBottom != '') $Parameters .= ' --bottom '.$this->BorderBottom;
    2639    $Output = shell_exec('echo "'.addslashes($Encoding->FromUTF8($HtmlCode)).
    27       '"|htmldoc --no-numbered --webpage --no-embedfonts --charset 8859-2 -t pdf -');
     40      '"|htmldoc '.$Parameters.' -');
    2841    return $Output;
    2942  }
Note: See TracChangeset for help on using the changeset viewer.