* Convert html to a Doc file.
*
* @param array $pages
+ * List of HTML snippets.
* @param string $fileName
+ * The logical filename to return to client.
+ * Ex: "HelloWorld.odt".
* @param array|int $format
*/
public static function html2doc($pages, $fileName, $format = array()) {
/**
* @param object|string $phpWord
* @param string $ext
+ * File extension/type.
+ * Ex: docx, odt, html.
* @param 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".
*/
public static function printDoc($phpWord, $ext, $fileName) {
$formats = array(
/**
* Modify contents of docx/odt file(s) and later merged into one final document
*
- * @param string $filePath
- * Document file path
* @param array $contents
- * Content of formatted/token-replaced document
+ * Content of formatted/token-replaced document.
+ * List of HTML snippets.
+ * @param string $fileName
+ * The logical filename to return to client.
+ * Ex: "HelloWorld.odt".
* @param string $docType
* Document type e.g. odt/docx
* @param clsTbsZip $zip
*
* @return string
*/
- public static function printDocuments($filePath, $contents, $docType, $zip, $returnFinalContent = FALSE) {
+ public static function printDocuments($contents, $fileName, $docType, $zip, $returnFinalContent = FALSE) {
$dataMap = self::$ooxmlMap[$docType];
$finalContent = $zip->FileRead($dataMap['dataFile']);
// Replace the loaded document file content located at $filePath with $finaContent
$zip->FileReplace($dataMap['dataFile'], $finalContent, TBSZIP_STRING);
- $fileName = pathinfo($filePath, PATHINFO_FILENAME) . '.' . $docType;
$zip->Flush(TBSZIP_DOWNLOAD, $fileName);
}