ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTCPDFGenerator Class Reference

Class ilTCPDFGenerator. More...

+ Collaboration diagram for ilTCPDFGenerator:

Static Public Member Functions

static generatePDF (ilPDFGenerationJob $job)

Detailed Description

Class ilTCPDFGenerator.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 11 of file class.ilTCPDFGenerator.php.

Member Function Documentation

static ilTCPDFGenerator::generatePDF ( ilPDFGenerationJob  $job)
static

Definition at line 13 of file class.ilTCPDFGenerator.php.

References $result, ilPDFGenerationJob\getAuthor(), ilPDFGenerationJob\getAutoPageBreak(), ilPDFGenerationJob\getCreator(), ilPDFGenerationJob\getFilename(), ilPDFGenerationJob\getImageScale(), ilPDFGenerationJob\getKeywords(), ilPDFGenerationJob\getMarginBottom(), ilPDFGenerationJob\getMarginLeft(), ilPDFGenerationJob\getMarginRight(), ilPDFGenerationJob\getMarginTop(), ilPDFGenerationJob\getOutputMode(), ilPDFGenerationJob\getPages(), ilPDFGenerationJob\getSubject(), and ilPDFGenerationJob\getTitle().

Referenced by ilPDFGeneration\doJob().

{
require_once 'tcpdf/tcpdf.php';
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator( $job->getCreator() );
$pdf->SetAuthor( $job->getAuthor() );
$pdf->SetTitle( $job->getTitle() );
$pdf->SetSubject( $job->getSubject() );
$pdf->SetKeywords( $job->getKeywords() );
//$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 006', PDF_HEADER_STRING); // TODO
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); // TODO
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // TODO
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // TODO
$pdf->SetMargins($job->getMarginLeft(), $job->getMarginTop(), $job->getMarginRight());
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER); // TODO
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // TODO
$pdf->SetAutoPageBreak($job->getAutoPageBreak(), $job->getMarginBottom());
$pdf->setImageScale($job->getImageScale());
$pdf->SetFont('dejavusans', '', 10); // TODO
/* // TODO
// set some language-dependent strings (optional)
if (file_exists(dirname(__FILE__).'/lang/eng.php')) {
require_once(dirname(__FILE__).'/lang/eng.php');
$pdf->setLanguageArray($l);
}
*/
// set font
foreach ($job->getPages() as $page)
{
$pdf->AddPage();
$pdf->writeHTML($page, true, false, true, false, '');
}
$result = $pdf->Output($job->getFilename(), $job->getOutputMode() ); // (I - Inline, D - Download, F - File)
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: