Changeset 901 for trunk/Modules/Finance/Bill.php
- Timestamp:
- Feb 17, 2021, 9:27:32 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/Bill.php
r888 r901 1 1 <?php 2 2 3 class Bill extends Model3 class Bill extends Pdf 4 4 { 5 5 public int $SpecificSymbol = 1; // computer network number 6 public bool $Checked = false;7 8 function GenerateHTML(): string9 {10 return '';11 }12 13 function SaveToFile(string $FileName): void14 {15 $PdfData = $this->HtmlToPdf($this->GenerateHTML());16 file_put_contents($FileName, $PdfData);17 }18 19 function HtmlToPdf(string $HtmlCode): string20 {21 $Encoding = new Encoding();22 if ($this->Checked == false) {23 if (CommandExist('htmldoc')) {24 $this->Checked = true;25 } else throw new Exception('htmldoc is not installed.');26 }27 $Output = shell_exec('echo "'.addslashes($Encoding->FromUTF8($HtmlCode)).28 '"|htmldoc --no-numbered --webpage --no-embedfonts --charset 8859-2 -t pdf -');29 return $Output;30 }31 6 } 32 7
Note:
See TracChangeset
for help on using the changeset viewer.