if ($_GET['op'] == 'add_certificate_template') { $mainTemplateXMLFile = new EfrontFile(G_CERTIFICATETEMPLATEPATH . "Minimum Decoration (Unicode).xml"); $mainTemplateXMLFileContents = file_get_contents($mainTemplateXMLFile['path']); $form->setDefaults(array('certificate_xml' => $mainTemplateXMLFileContents)); } else { if ($_GET['op'] == 'edit_certificate_template') { $editTemplate = eF_getTableData("certificate_templates", "certificate_name, certificate_xml", "id=" . $tid); $form->setDefaults($editTemplate[0]); } } if ($form->isSubmitted() && $form->validate()) { global $popup; isset($popup) && $popup == 1 ? $popup_ = '&popup=1' : ($popup_ = ''); $formValues = $form->exportValues(); if (in_array('preview_certificate_template', array_keys($formValues))) { $xmlExport = new XMLExport($formValues['certificate_xml']); $creator = $xmlExport->getCreator(); $author = $xmlExport->getAuthor(); $subjct = $xmlExport->getSubject(); $keywrd = $xmlExport->getKeywords(); $orientation = $xmlExport->getOrientation(); $pdf = new TCPDF($orientation, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator($creator); $pdf->SetAuthor($author); $pdf->SetTitle($subjct); $pdf->SetSubject($subjct); $pdf->SetKeywords($keywrd); $xmlExport->setBackground($pdf); $pdf->SetAutoPageBreak(false); $pdf->setFontSubsetting(false); //Line for adding a high resolution image in background as full certificate image.
* diff -u -I "[ ]*<date>.*</date>" -I "[ ]*<create_date>.*</create_date>" -I "[ ]*<update_date>.*</update_date>" -I "[ ]*<owner>.*</owner>" -I "[ ]*<author>.*</author>" file1.xml file2.xml */ set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/../../../../src' . PATH_SEPARATOR . dirname(__FILE__) . '/../../../../src/www/include'); require 'pre.php'; require 'XMLExport.class.php'; function error($str) { echo "*** Error: {$str}" . PHP_EOL; } function usage() { echo "Usage: export.php groupId targetname" . PHP_EOL; } if (!isset($argv[2])) { error("No target directory specified"); usage(); return false; } if (is_file($argv[2])) { error("Target directoy already exists"); usage(); return false; } $start = microtime(true); $XMLExport = new XMLExport(); $XMLExport->setGroupId($argv[1]); $XMLExport->setArchiveName($argv[2]); //echo $XMLExport->dump()->saveXML(); $XMLExport->dumpPackage(); $end = microtime(true); echo "Elapsed time: " . ($end - $start) . PHP_EOL;