Skip to content

Commit

Permalink
remove old function
Browse files Browse the repository at this point in the history
  • Loading branch information
skerbis authored Jan 2, 2023
1 parent fad152a commit 3b9c3c7
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@
rex_dir::create($addon->getCachePath());
rex_dir::create(rex_path::addonCache('pdfout', 'fonts'));

require_once $addon->getPath('vendor/'.'autoload.php');
require_once $addon->getPath('vendor/' . 'autoload.php');

if (rex::isBackend() && rex::getUser()!== null) {
if (rex::isBackend() && rex::getUser() !== null) {
$print_pdftest = rex_request('pdftest', 'int');
if ($print_pdftest === 1) {
$file = '';
$file = rex_file::get(rex_path::addon('pdfout', 'README.md'));
if($file!=='' && $file!==null)
{
$readmeHtml = '<style>body {font-family: DejaVu Sans; }</style>'.rex_markdown::factory()->parse($file);
PdfOut::sendPdf('readme',$readmeHtml);
if ($file !== '' && $file !== null) {
$readmeHtml = '<style>body {font-family: DejaVu Sans; }</style>' . rex_markdown::factory()->parse($file);
$pdf = new PdfOut();
$pdf->setName('PDFOut-Readme')
->setFont('DejaVu Sans')
->setHtml($readmeHtml, true)
->setOrientation('portrait')
->setAttachment(false)
->setRemoteFiles(false)
// execute and generate
$pdf->run();
}
}
}

0 comments on commit 3b9c3c7

Please sign in to comment.