interface pdf_adapter_interface

internal  
 

PDF Adapter Interface.

Provides a generic contract for PDF generation, decoupling the application from specific libraries like TCPDF or DomPDF.

Methods

set_html(string $html)

Set the HTML content for the PDF.

set_metadata(array $metadata)

Set PDF metadata.

set_orientation(string $orientation)

Set page orientation.

string
output(string $filename = 'document.pdf', string $dest = 'I')

Output the PDF to the browser or as a string.

Details

at line 37
pdf_adapter_interface set_html(string $html)

Set the HTML content for the PDF.

Parameters

string $html

Return Value

pdf_adapter_interface

at line 46
pdf_adapter_interface set_metadata(array $metadata)

Set PDF metadata.

Parameters

array $metadata

Key-value pairs (title, author, etc)

Return Value

pdf_adapter_interface

at line 55
pdf_adapter_interface set_orientation(string $orientation)

Set page orientation.

Parameters

string $orientation

'P' for Portrait, 'L' for Landscape

Return Value

pdf_adapter_interface

at line 65
string output(string $filename = 'document.pdf', string $dest = 'I')

Output the PDF to the browser or as a string.

Parameters

string $filename

The name of the file (if applicable)

string $dest

'I' for inline, 'D' for download, 'S' for string, 'F' for local file

Return Value

string