Table of contents
Namespace: Com\Tecnick\Pdf\Output
trait Document
Source: src/Output/Document.php:45
PDF file structure: header, body, cross-reference table, trailer, incremental revisions and output.
Methods
downloadPDF()
Trigger the browser Download dialog to download the PDF document.
public downloadPDF(string $rawpdf = ''): void
Parameters:
$rawpdf(string): Raw PDF data string from getOutPDFString().
Throws:
Throwable
Source: src/Output/Document.php:490
getMIMEAttachmentPDF()
Returns the PDF as base64 mime multi-part email attachment (RFC 2045).
public getMIMEAttachmentPDF(string $rawpdf = ''): string
Parameters:
$rawpdf(string): Raw PDF data string from getOutPDFString().
Returns: string: Email attachment as raw string.
Source: src/Output/Document.php:594
getOutPDFString()
Returns the RAW PDF string.
public getOutPDFString(): string
Returns: string: PDF document content.
Throws:
Source: src/Output/Document.php:60
renderPDF()
Render the PDF in the browser or output the RAW data in the CLI.
public renderPDF(string $rawpdf = ''): void
Parameters:
$rawpdf(string): Raw PDF data string from getOutPDFString().
Throws:
Throwable
Source: src/Output/Document.php:451
savePDF()
Save the PDF document to a local file.
The file is written in the $path directory with the base name returned by getPDFFilename().
public savePDF(string $path = '', string $rawpdf = ''): void
Parameters:
$path(string): Path to the output directory.$rawpdf(string): Raw PDF data string from getOutPDFString().
Throws:
Throwable
Source: src/Output/Document.php:573