Changeset 902 for trunk/Packages/Common


Ignore:
Timestamp:
Feb 18, 2021, 1:59:28 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Improved generation of contracts.
Location:
trunk/Packages/Common
Files:
2 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  }
  • trunk/Packages/Common/PrefixMultiplier.php

    r874 r902  
    7272class PrefixMultiplier
    7373{
    74   function TruncateDigits($Value, $Digits = 4)
     74  function TruncateDigits($Value, $Digits = 4): string
    7575  {
    7676    for ($II = 2; $II > -6; $II--)
     
    8787  }
    8888
    89   function Add($Value, $Unit, $Digits = 4, $PrefixType = 'Decimal')
     89  function Add($Value, $Unit, $Digits = 4, $PrefixType = 'Decimal'): string
    9090  {
    9191    global $PrefixMultipliers;
Note: See TracChangeset for help on using the changeset viewer.