class CRM_Utils_PDF_Document

Class CRM_Utils_PDF_Document.

Properties

static $ooxmlMap

Methods

static 
html2doc(array $pages, string $fileName, array|int $format = array())

Convert html to a Doc file.

static 
printDoc(object|string $phpWord, string $ext, string $fileName)

No description

static int
toTwip($value, $metric)

No description

static array
docReader(array $path, string $type)

No description

static array
unzipDoc(string $filePath, string $docType)

Extract content of docx/odt file

static string
printDocuments(array $contents, string $fileName, string $docType, clsTbsZip $zip, bool $returnFinalContent = FALSE)

Modify contents of docx/odt file(s) and later merged into one final document

Details

at line 66
static html2doc(array $pages, string $fileName, array|int $format = array())

Convert html to a Doc file.

Parameters

array $pages List of HTML snippets.
string $fileName The logical filename to return to client. Ex: "HelloWorld.odt".
array|int $format

at line 114
static printDoc(object|string $phpWord, string $ext, string $fileName)

Parameters

object|string $phpWord
string $ext File extension/type. Ex: docx, odt, html.
string $fileName The logical filename to return to client. Ex: "HelloWorld.odt". Alternatively, a full path of a file to display. This seems sketchy. Ex: "/var/lib/data/HelloWorld.odt".

at line 140
static int toTwip($value, $metric)

Parameters

$value
$metric

Return Value

int

at line 152
static array docReader(array $path, string $type)

Parameters

array $path docx/odt file path
string $type File type

Return Value

array Return extracted content of document in HTML and document type

at line 172
static array unzipDoc(string $filePath, string $docType)

Extract content of docx/odt file

Parameters

string $filePath Document file path
string $docType File type of document

Return Value

array [string, clsTbsZip]

at line 200
static string printDocuments(array $contents, string $fileName, string $docType, clsTbsZip $zip, bool $returnFinalContent = FALSE)

Modify contents of docx/odt file(s) and later merged into one final document

Parameters

array $contents Content of formatted/token-replaced document. List of HTML snippets.
string $fileName The logical filename to return to client. Ex: "HelloWorld.odt".
string $docType Document type e.g. odt/docx
clsTbsZip $zip Zip archive
bool $returnFinalContent Return the content of file document as a string used in unit test

Return Value

string