TCPDFFacade
A facade class for the TCPDF library which is used to convert some HTML content provided by the Markdown library to a PDF file using FPDF.
Tags
Table of Contents
- $article : Article
- The business object that stores the content will be rendered to Markdown.
- $content : string
- The HTML-format content that we will render as a PDF.
- $HTMLCacheKey : string
- The auto-generated name of the HTML cache key for the article generated by Markdown.
- $logger : Logger
- Trace logger.
- $pdf : TCPDF
- The PDF object that will be generated from the Markdown HTML content.
- $PDFCacheKey : string
- The auto-generated name of the PDF cache key for the article.
- __construct() : mixed
- The constructor.
- getContent() : string
- Fetter for the content.
- getPDFData() : string
- Returns the raw PDF data stream from the cache (should be warm first before calling this method).
- markdown() : mixed
- Facade method which will invoke our custom markdown class rather than the standard one.
Properties
$article
The business object that stores the content will be rendered to Markdown.
private
Article
$article
= null
Tags
$content
The HTML-format content that we will render as a PDF.
private
string
$content
Tags
$HTMLCacheKey
The auto-generated name of the HTML cache key for the article generated by Markdown.
private
string
$HTMLCacheKey
Tags
$logger
Trace logger.
private
static Logger
$logger
= null
Tags
The PDF object that will be generated from the Markdown HTML content.
private
TCPDF
$pdf
Tags
$PDFCacheKey
The auto-generated name of the PDF cache key for the article.
private
string
$PDFCacheKey
Tags
Methods
__construct()
The constructor.
public
__construct(ActiveRecord $article) : mixed
Parameters
- $article : ActiveRecord
-
the business object that stores the content will be rendered to Markdown
Tags
Return values
mixed —getContent()
Fetter for the content.
public
getContent() : string
Tags
Return values
string —HTML rendered the content
getPDFData()
Returns the raw PDF data stream from the cache (should be warm first before calling this method).
public
getPDFData() : string
Tags
Return values
string —markdown()
Facade method which will invoke our custom markdown class rather than the standard one.
private
markdown( $text) : mixed