1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 08:51:34 +02:00
invoiceninja/app/Services/Pdf/PdfService.php
2022-12-23 13:46:52 +11:00

86 lines
1.9 KiB
PHP

<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Services\Pdf;
use App\Services\Pdf\PdfConfiguration;
use App\Utils\HtmlEngine;
class PdfService
{
public $invitation;
public PdfConfiguration $config;
public PdfBuilder $builder;
public PdfDesigner $designer;
public array $html_variables;
public function __construct($invitation)
{
$this->invitation = $invitation;
$this->config = (new PdfConfiguration($this))->init();
$this->html_variables = (new HtmlEngine($invitation))->generateLabelsAndValues();
$this->builder = (new PdfBuilder($this));
$this->designer = (new PdfDesigner($this))->build();
}
public function build()
{
$this->builder->build();
}
public function getPdf()
{
}
public function getHtml()
{
}
// $state = [
// 'template' => $template->elements([
// 'client' => $this->client,
// 'entity' => $this->entity,
// 'pdf_variables' => (array) $this->company->settings->pdf_variables,
// '$product' => $design->design->product,
// 'variables' => $variables,
// ]),
// 'variables' => $variables,
// 'options' => [
// 'all_pages_header' => $this->entity->client->getSetting('all_pages_header'),
// 'all_pages_footer' => $this->entity->client->getSetting('all_pages_footer'),
// ],
// 'process_markdown' => $this->entity->client->company->markdown_enabled,
// ];
// $maker = new PdfMakerService($state);
// $maker
// ->design($template)
// ->build();
}