3 require_once
'./Services/PDFGeneration/interfaces/interface.ilRendererConfig.php';
4 require_once
'./Services/PDFGeneration/interfaces/interface.ilPDFRenderer.php';
19 $this->lng = $DIC[
'lng'];
33 $margin_left =
new ilTextInputGUI($this->lng->txt(
'margin_left'),
'margin_left');
36 $margin_top =
new ilTextInputGUI($this->lng->txt(
'margin_top'),
'margin_top');
39 $margin_right =
new ilTextInputGUI($this->lng->txt(
'margin_right'),
'margin_right');
42 $margin_bottom =
new ilTextInputGUI($this->lng->txt(
'margin_bottom'),
'margin_bottom');
45 $image_scale =
new ilTextInputGUI($this->lng->txt(
'image_scale'),
'image_scale');
118 'margin_left' =>
'10',
119 'margin_top' =>
'10',
120 'margin_right' =>
'10',
121 'margin_bottom' =>
'10',
122 'image_scale' =>
'1',
143 ->setZoomFactor(0.17);
156 require_once
'libs/composer/vendor/autoload.php';
162 $pdf->SetAutoPageBreak(
'auto',
$config[
'margin_buttom']);
170 $pdf->SetFont(
'dejavusans',
'', 10);
171 $pdf->setSpacesRE(
'/[^\S\xa0]/');
173 foreach ($job->getPages() as $page) {
176 $pdf->writeHTML($page,
true,
false,
true,
false,
'');
178 $result =
$pdf->Output(basename($job->getFilename()), $job->getOutputMode());
180 if (in_array($job->getOutputMode(), array(
'I',
'D'))) {
const PDF_MARGIN_HEADER
Header margin.
const RENDER_PNG_AS_IMG_EMBED
const PDF_FONT_SIZE_MAIN
Default main font size.
getConfigFromForm(\ilPropertyFormGUI $form, $service, $purpose)
from ilRendererConfig
const PDF_FONT_SIZE_DATA
Default data font size.
const PDF_FONT_NAME_MAIN
Default main font name.
PHP class for generating PDF documents without requiring external extensions.
const PDF_UNIT
Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
validateConfigInForm(\ilPropertyFormGUI $form, $service, $purpose)
from ilRendererConfig
if(isset($_POST['submit'])) $form
prepareGenerationRequest($service, $purpose)
Prepare the content processing at the beginning of a PDF generation request Should be used to initial...
generatePDF($service, $purpose, $config, $job)
from ilPDFRenderer
This class represents a text property in a property form.
const PDF_PAGE_ORIENTATION
Page orientation (P=portrait, L=landscape).
static getInstance()
Singleton: get instance.
const PDF_FONT_NAME_DATA
Default data font name.
getDefaultConfig($service, $purpose)
from ilRendererConfig
const PDF_PAGE_FORMAT
Page format.
const PDF_FONT_MONOSPACED
Default monospaced font name.
__construct()
from ilPlugin
populateConfigElementsInForm(\ilPropertyFormGUI $form, $service, $purpose, $config)
from ilRendererConfig
addConfigElementsToForm(\ilPropertyFormGUI $form, $service, $purpose)
from ilRendererConfig
const PDF_MARGIN_FOOTER
Footer margin.