This commit introduces a new PDF generation module leveraging the HTML2PDF library. The module generates PDFs from HTML templates, supports customization through styles and templates, and integrates with Minio for storage and retrieval. A test route is added for generating and serving PDFs dynamically.
26 lines
896 B
PHP
26 lines
896 B
PHP
<?php
|
|
|
|
namespace html2pdf\helpers;
|
|
|
|
interface html2pdf_template_i
|
|
{
|
|
/**
|
|
* Add an image to the template
|
|
* @param string $imagePath
|
|
* @param string $altText
|
|
* @param int $height
|
|
* @param int $width
|
|
* @param string $align
|
|
*
|
|
* @return string HTML string for the image
|
|
*/
|
|
public function addImage(string $imagePath, string $altText = '', int $height = 100, int $width = 100, string $align = 'center'): string;
|
|
|
|
/**
|
|
* Get a src path for the template
|
|
* @notation This method is used to get the path of e.g. images (e.g. truckwash-banner-white-compressed.png)
|
|
* @param string $path The path to the file, relative to the modules src directory.
|
|
* @return string The full path to the file. (e.g. /var/www/html/modules/html2pdf/src/truckwash-banner-white-compressed.png)
|
|
*/
|
|
public function pathSrc(string $path): string;
|
|
} |