getMyMotionType()); /** @var \app\views\pdfLayouts\BDKPDF $pdf */ $pdf = $pdfLayout->createPDFClass(); // set document information $pdf->SetCreator(Yii::t('export', 'default_creator')); $pdf->SetTitle(Yii::t('motion', 'Motion') . " " . $motion->getTitleWithPrefix() . ' - Merge Draft'); $pdf->SetSubject(Yii::t('motion', 'Motion') . " " . $motion->getTitleWithPrefix() . ' - Merge Draft'); $pdf->setMotionTitle($motion->getTitleWithPrefix(), Yii::t('export', 'draft')); $pdf->startPageGroup(); $pdf->AddPage(); $motionData = '
'; $motionData .= Yii::t('export', 'pdf_merging_draft'); $motionData .= '

'; $motionData .= ''; $motionData .= Html::encode($motion->getFormattedTitlePrefix()) . ' '; $motionData .= ''; $motionData .= Html::encode($motion->title) . ''; BDK::printHeaderTable($pdf, $motion->getMyMotionType()->getSettingsObj()->pdfIntroduction, $motionData); $pdf->setHtmlVSpace([ 'ul' => [['h' => 0, 'n' => 0], ['h' => 0, 'n' => 0]], 'li' => [['h' => 0, 'n' => 0], ['h' => 0, 'n' => 0]], 'div' => [['h' => 0, 'n' => 0], ['h' => 0, 'n' => 0]], 'p' => [['h' => 0, 'n' => 0], ['h' => 0, 'n' => 0]], 'blockquote' => [['h' => 0, 'n' => 0], ['h' => 0, 'n' => 0]], ]); foreach ($motion->getActiveSections(ISectionType::TYPE_TEXT_SIMPLE) as $section) { $pdf->SetFont('Helvetica'); $pdf->writeHTML('

' . Html::encode($section->getSettings()->title) . '


'); $pdf->SetFont('Courier'); $paragraphs = []; foreach ($section->getTextParagraphLines() as $para) { $paragraphs[] = $draft->paragraphs[$section->sectionId . '_' . $para->paragraphWithLineSplit]->text; } $html = implode("\n", $paragraphs); $html = \app\views\motion\LayoutHelper::convertMergingHtmlToTcpdfable($html); $pdf->writeHTML($html); } $pdf->Output($motion->getFilenameBase(true) . '-Merging-Draft.pdf', 'I');