3require_once
'./Services/PDFGeneration/interfaces/interface.ilRendererConfig.php';
4require_once
'./Services/PDFGeneration/interfaces/interface.ilPDFRenderer.php';
19 $this->lng =
$DIC[
'lng'];
33 $margin_left =
new ilTextInputGUI($this->lng->txt(
'margin_left'),
'margin_left');
34 $form->addItem($margin_left);
36 $margin_top =
new ilTextInputGUI($this->lng->txt(
'margin_top'),
'margin_top');
37 $form->addItem($margin_top);
39 $margin_right =
new ilTextInputGUI($this->lng->txt(
'margin_right'),
'margin_right');
40 $form->addItem($margin_right);
42 $margin_bottom =
new ilTextInputGUI($this->lng->txt(
'margin_bottom'),
'margin_bottom');
43 $form->addItem($margin_bottom);
45 $image_scale =
new ilTextInputGUI($this->lng->txt(
'image_scale'),
'image_scale');
46 $form->addItem($image_scale);
61 $form->getItemByPostVar(
'margin_left')->setValue(
$config[
'margin_left']);
62 $form->getItemByPostVar(
'margin_right')->setValue(
$config[
'margin_right']);
63 $form->getItemByPostVar(
'margin_top')->setValue(
$config[
'margin_top']);
64 $form->getItemByPostVar(
'margin_bottom')->setValue(
$config[
'margin_bottom']);
65 $form->getItemByPostVar(
'image_scale')->setValue(
$config[
'image_scale']);
96 'margin_left' =>
$form->getItemByPostVar(
'margin_left')->getValue(),
97 'margin_right' =>
$form->getItemByPostVar(
'margin_right')->getValue(),
98 'margin_top' =>
$form->getItemByPostVar(
'margin_top')->getValue(),
99 'margin_bottom' =>
$form->getItemByPostVar(
'margin_bottom')->getValue(),
100 'image_scale' =>
$form->getItemByPostVar(
'image_scale')->getValue(),
118 'margin_left' =>
'10',
119 'margin_top' =>
'10',
120 'margin_right' =>
'10',
121 'margin_bottom' =>
'10',
122 'image_scale' =>
'1',
138 require_once
'libs/composer/vendor/autoload.php';
144 $pdf->SetAutoPageBreak(
'auto',
$config[
'margin_buttom']);
152 $pdf->SetFont(
'dejavusans',
'', 10);
153 $pdf->setSpacesRE(
'/[^\S\xa0]/');
155 foreach ($job->getPages() as $page) {
158 $pdf->writeHTML($page,
true,
false,
true,
false,
'');
160 $result =
$pdf->Output($job->getFilename(), $job->getOutputMode());
162 if (in_array($job->getOutputMode(), array(
'I',
'D'))) {
An exception for terminatinating execution or to throw for unit testing.
PHP class for generating PDF documents without requiring external extensions.
addConfigElementsToForm(\ilPropertyFormGUI $form, $service, $purpose)
from ilRendererConfig
populateConfigElementsInForm(\ilPropertyFormGUI $form, $service, $purpose, $config)
from ilRendererConfig
validateConfigInForm(\ilPropertyFormGUI $form, $service, $purpose)
from ilRendererConfig
generatePDF($service, $purpose, $config, $job)
from ilPDFRenderer
getDefaultConfig($service, $purpose)
from ilRendererConfig
getConfigFromForm(\ilPropertyFormGUI $form, $service, $purpose)
from ilRendererConfig
__construct()
from ilPlugin
This class represents a text property in a property form.
if(isset($_POST['submit'])) $form
const PDF_FONT_NAME_MAIN
Default main font name.
const PDF_MARGIN_FOOTER
Footer margin.
const PDF_PAGE_FORMAT
Page format.
const PDF_MARGIN_HEADER
Header margin.
const PDF_FONT_MONOSPACED
Default monospaced font name.
const PDF_FONT_NAME_DATA
Default data font name.
const PDF_FONT_SIZE_DATA
Default data font size.
const PDF_PAGE_ORIENTATION
Page orientation (P=portrait, L=landscape).
const PDF_UNIT
Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
const PDF_FONT_SIZE_MAIN
Default main font size.