public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) { require_once 'phpdocx/classes/TransformDoc.inc'; $tmpDoc = $fileview->toTmpFile($path); $transformdoc = new \TransformDoc(); $transformdoc->setStrFile($tmpDoc); $transformdoc->generatePDF($tmpDoc); $pdf = new \imagick($tmpDoc . '[0]'); $pdf->setImageFormat('jpg'); unlink($tmpDoc); $image = new \OC_Image($pdf); return $image->valid() ? $image : false; }
public function download($name, $print = null) { require_once '../Vendor/phpdocxCorporate/classes/TransformDoc.inc'; require_once '../Vendor/phpdocxCorporate/classes/CreateDocx.inc'; $pdf = new TransformDoc(); $pdf->setStrFile($name); $pdfname = ''; if ($print) { $pdfname = $pdf->generatePrintPDF('system/print_documents/'); } else { $pdf->generatePDF(); } @unlink($name); return $pdfname; }
<?php /** * Create a DOCX file. Transform DOCX to PDF * * @category Phpdocx * @package examples * @subpackage easy * @copyright Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L. * (http://www.2mdc.com) * @license LGPL * @version 2.0 * @link http://www.phpdocx.com * @since File available since Release 2.0 */ require_once '../../classes/TransformDoc.inc'; $document = new TransformDoc(); $document->setStrFile('../files/Text.docx'); $document->generatePDF();
public function test() { $document = new TransformDoc(); $document->setStrFile('/system/documents/new.docx'); $document->generatePDF(); }