1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-22 17:31:35 +02:00
invoiceninja/app/Services/Pdf/PdfService.php

90 lines
2.0 KiB
PHP
Raw Normal View History

2022-12-23 03:22:01 +01:00
<?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;
2022-12-23 03:46:52 +01:00
use App\Utils\HtmlEngine;
2022-12-23 03:22:01 +01:00
class PdfService
{
public $invitation;
2022-12-23 10:51:24 +01:00
public Company $company;
2022-12-23 03:22:01 +01:00
public PdfConfiguration $config;
2022-12-23 03:46:52 +01:00
public PdfBuilder $builder;
public PdfDesigner $designer;
public array $html_variables;
2022-12-23 03:22:01 +01:00
public function __construct($invitation)
{
$this->invitation = $invitation;
2022-12-23 10:51:24 +01:00
$this->company = $invitation->company;
2022-12-23 03:22:01 +01:00
$this->config = (new PdfConfiguration($this))->init();
2022-12-23 03:46:52 +01:00
$this->html_variables = (new HtmlEngine($invitation))->generateLabelsAndValues();
$this->builder = (new PdfBuilder($this));
$this->designer = (new PdfDesigner($this))->build();
}
public function build()
{
$this->builder->build();
2022-12-23 03:22:01 +01:00
}
public function getPdf()
{
}
public function getHtml()
{
}
2022-12-23 03:46:52 +01:00
// $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();
2022-12-23 03:22:01 +01:00
}