CRM_Utils_PDF_Utils
in package
Tags
Table of Contents
Methods
- _html2pdf_dompdf() : string
- _html2pdf_weasyprint() : mixed
- _html2pdf_wkhtmltopdf() : mixed
- convertMetric() : float|int
- convert value from one metric to another.
- html2pdf() : string|void
- getCacheDir() : string
- Get location of cache folder.
- getDompdfOptions() : Options
- Allow setting some dompdf options.
Methods
_html2pdf_dompdf()
public
static _html2pdf_dompdf(mixed $paper_size, mixed $orientation, mixed $html, mixed $output, string $fileName) : string
Parameters
- $paper_size : mixed
- $orientation : mixed
- $html : mixed
- $output : mixed
- $fileName : string
Return values
string_html2pdf_weasyprint()
public
static _html2pdf_weasyprint(string $html, bool $output, string $fileName) : mixed
Parameters
- $html : string
- $output : bool
- $fileName : string
_html2pdf_wkhtmltopdf()
public
static _html2pdf_wkhtmltopdf(float|array<string|int, int> $paper_size, string $orientation, array<string|int, mixed> $margins, string $html, bool $output, string $fileName) : mixed
Parameters
- $paper_size : float|array<string|int, int>
- $orientation : string
- $margins : array<string|int, mixed>
- $html : string
- $output : bool
- $fileName : string
convertMetric()
convert value from one metric to another.
public
static convertMetric(int $value, string $from, string $to[, int|null $precision = NULL ]) : float|int
Parameters
- $value : int
- $from : string
- $to : string
- $precision : int|null = NULL
Return values
float|inthtml2pdf()
public
static html2pdf(array<string|int, mixed> $text[, string $fileName = 'civicrm.pdf' ][, bool $output = FALSE ][, array<string|int, mixed>|int|null $pdfFormat = NULL ]) : string|void
Parameters
- $text : array<string|int, mixed>
-
List of HTML snippets.
- $fileName : string = 'civicrm.pdf'
-
The logical filename to display. Ex: "HelloWorld.pdf".
- $output : bool = FALSE
-
FALSE to display PDF. TRUE to return as string.
- $pdfFormat : array<string|int, mixed>|int|null = NULL
-
Unclear. Possibly PdfFormat or formValues.
Return values
string|voidgetCacheDir()
Get location of cache folder.
private
static getCacheDir(array<string|int, mixed> $settings) : string
Parameters
- $settings : array<string|int, mixed>
Return values
stringgetDompdfOptions()
Allow setting some dompdf options.
private
static getDompdfOptions() : Options
We don't support all the available dompdf options.