create([ 'OUT_DOC_TEMPLATE' => '

TEST OUTPUT DOCUMENT 内

this is some font

', ]); // Prepare the font arialuni.ttf $arialBkp = PATH_TRUNK . 'tests' . PATH_SEP . 'resources' . PATH_SEP . 'fonts' . PATH_SEP; $fonts = PATH_DATA . 'fonts' . PATH_SEP; if (!file_exists($fonts)) { G::mk_dir($fonts); } G::recursive_copy($arialBkp, $fonts); // Define the path for generate the pdf $appUid = G::generateUniqueID(); $pathOutput = PATH_DB . config('system.workspace') . PATH_SEP . 'files' . G::getPathFromUID($appUid) . PATH_SEP . 'outdocs' . PATH_SEP; G::mk_dir($pathOutput); // Define some parameters $fields = []; $fields['USR_USERNAME'] = G::generateUniqueID(); // Define some atributes for the pdf $properties = []; $properties['margins'] = []; $properties['margins']['left'] = 15; $properties['margins']['right'] = 15; $properties['margins']['top'] = 15; $properties['margins']['bottom'] = 15; $properties['pdfSecurity'] = true; // Call output document $outputDocument = new OutputDocument(); $outputDocument->generateTcpdf( $output->OUT_DOC_UID, $fields, $pathOutput, $output->OUT_DOC_FILENAME, $output->OUT_DOC_TEMPLATE, false, $properties ); $this->assertFileExists($pathOutput . $output->OUT_DOC_FILENAME . '.pdf'); // Remove the shared folder G::rm_dir($fonts); } }