Renders the Dompdf instance.

@param \CakePdf\Pdf\CakePdf $Pdf The CakePdf instance that supplies the content to render.
@param \Dompdf\Dompdf $DomPDF The Dompdf instance to render.
@return \Dompdf\Dompdf
495825
protected function _render($Pdf, $DomPDF)
    {
        $DomPDF->loadHtml($Pdf->html());
        $DomPDF->render();

        return $DomPDF;
    }
1124775
public function render(\DOMDocument $domDocument)
    {
        $container = new Frame();
        $container->setPosition($this->frame_posX, $this->frame_posY);

        $quad = new Quad();
        // this quad is used to placeholder, if you need to add later "frame"  to the view.

        $contentFrame = new Frame();
        $contentFrame->addChild($this->parentFrame);

        $container->addChild($quad);
        $container->addChild($contentFrame);
        if ($this->scrollbarV) {
            $contentFrame->setSize($this->width - 5, $this->height);
            $this->offset = 5;
            $container->addChild(new Scrollbar(
                "Y",
                $this->getWidth(),
                0,
                10,
                $this->getHeight()
            ));
        }

        if ($this->scrollbarH) {
            $contentFrame->setSize($this->width - 5, $this->height - 5);
            $container->addChild(new Scrollbar(
                "X",
                0,
                -$this->getHeight(),
                10,
                $this->getWidth() - $this->offset
            ));
        }


        return $container->render($domDocument);
    }
1325931
public function downloadpdf()
    {
        if (!$this->owner->data()->config()->get('pdf_export')) {
            return false;
        }

        // We only allow producing live pdf. There is no way to secure the draft files.
        Versioned::set_stage(Versioned::LIVE);

        $path = $this->owner->data()->getPdfFilename();
        if (!file_exists($path)) {
            $this->owner->generatePDF();
        }

        return HTTPRequest::send_file(file_get_contents($path), basename($path), 'application/pdf');
    }
1171242
public function render(\DOMDocument $domDocument)
    {
        $domElement = $domDocument->createElement("key");
        $domElement->setAttribute("x", $this->x);
        $domElement->setAttribute("color", $this->color);
        return $domElement;
    }
798927
public function render(\DOMDocument $domDocument)
    {
        $this->loadFeatures($this->features);

        $scriptXml  = $domDocument->createElement("script");
        $scriptText = $this->buildScriptText();

        $scriptComment = $domDocument->createComment($scriptText);
        $scriptXml->appendChild($scriptComment);

        return $scriptXml;
    }
1193493
public function render(\DOMDocument $domDocument)
    {
        $quad = Quad::create();
        $quad->setPosition($this->posX, $this->posY)->setZ($this->posZ)
            ->setOpacity(0.4)->setBackgroundColor("000")
            ->setSize($this->width, $this->height);
        if ($this->id) {
            $quad->setId($this->id);
        }
        if ($this->action) {
            $quad->setAction($this->action)->setFocusBackgroundColor("999");
        }

        return $quad->render($domDocument);
    }
1231471
public function getPdf($id = '')
	{
		$id = $id ? : $this->attributes[$this->primary_column];
		return $this->request('GET', sprintf('%s/%s', $this->getUrl(), $id), array(), "", "pdf");
	}
322964
public function render(PdfTemplateTransfer $pdfTemplate)
    {
        $loader = new Filesystem($this->config->getTwigTemplatePaths());
        $twig = new Twig_Environment($loader);
        $twig->setExtensions($this->extensions);

        $this->addFilters($twig);
        $this->addFunctions($twig);

        $path = $pdfTemplate->getPath();
        $parameter = $pdfTemplate->getParameter();

        if ($parameter === null) {
            $parameter = [];
        }

        return $twig->render($path, $parameter);
    }
649300
public function snappyPdf()
    {
        /** @var \Barryvdh\Snappy\PdfWrapper $snappy */
        $snappy      = resolve('snappy.pdf.wrapper');
        $options     = config('datatables-buttons.snappy.options');
        $orientation = config('datatables-buttons.snappy.orientation');

        $snappy->setOptions($options)->setOrientation($orientation);

        return $snappy->loadHTML($this->printPreview())->download($this->getFilename() . '.pdf');
    }
260834
public function pdf()
    {
        if ('snappy' == config('datatables-buttons.pdf_generator', 'snappy')) {
            return $this->snappyPdf();
        }

        return $this->buildExcelFile()->download($this->getFilename() . '.pdf', $this->pdfWriter);
    }
453090
public function openPdf($pdfTemplate)
	{
		$this->debug->groupCollapsed(__CLASS__.'->'.__FUNCTION__);
		$p = $this->p;
		$pdiOpts = 'errorpolicy=return';
		if (is_object($pdfTemplate) || preg_match('/[\\x00-\\x1f]/', $pdfTemplate)) {
			if (is_object($pdfTemplate)) {
				$this->debug->log('pdfTemplate is object');
				$p->create_pvf($this->pvf, $pdfTemplate->get_buffer(), '');
				$pdfTemplate->delete();
			} else {
				$this->debug->log('pdfTemplate is raw pdf data');
				$p->create_pvf($this->pvf, $pdfTemplate, '');
			}
			$pdfTemplate = null;
			$pdiNo = $p->open_pdi_document($this->pvf, $pdiOpts);
		} else {
			$this->debug->log('pdfTemplate', $pdfTemplate);
			$this->debug->log('file_exists', file_exists($pdfTemplate));
			try {
				$pdiNo = $p->open_pdi_document($pdfTemplate, $pdiOpts);
			} catch ( PDFlibException $e ) {
				trigger_error('PDFlib exception ['.$e->get_errnum().'] '.$e->get_apiname().' : '.$e->get_errmsg());
			}
			$this->debug->info('get_errmsg', $p->get_errmsg());
		}
		$this->debug->groupEnd();
		return $pdiNo;
	}
882313
public function actionPdf($id)
    {
        $model = $this->findModel($id);
        $content = $this->renderAjax('_pdf', [
            'model' => $model,
        ]);
        $pdf = new \kartik\mpdf\Pdf([
            'mode'        => \kartik\mpdf\Pdf::MODE_UTF8,
            'format'      => \kartik\mpdf\Pdf::FORMAT_A4,
            'orientation' => \kartik\mpdf\Pdf::ORIENT_PORTRAIT,
            'destination' => \kartik\mpdf\Pdf::DEST_BROWSER,
            'content'     => $content,
            'cssFile'     => '@vendor/kartik-v/yii2-mpdf/assets/kv-mpdf-bootstrap.min.css',
            'cssInline'   => '.kv-heading-1{font-size:18px}',
            'options'     => ['title' => \Yii::$app->name],
            'methods'     => [
                'SetHeader' => [\Yii::$app->name],
                'SetFooter' => ['{PAGENO}'],
            ],
        ]);

        return $pdf->render();
    }
1043652
public function generatePdf($settings) {
    if (empty($settings)) {
      return;
    }
    $temporary_directory = file_directory_temp();
    define("_MPDF_TEMP_PATH", $temporary_directory);
    ini_set("pcre.backtrack_limit", "5000000");
    $html = mb_convert_encoding(render($settings['body']), 'UTF-8', 'UTF-8');
    $mpdf = new \Mpdf\Mpdf(['format' => 'A4-L', 'tempDir' => $temporary_directory]);
    $stylesheet = file_get_contents(drupal_get_path('module', 'openy_repeat') . '/css/print_pdf.css');
    $mpdf->SetTitle($settings['title']);
    $mpdf->SetHTMLFooter(render($settings['footer']));
    $mpdf->WriteHTML($stylesheet, 1);
    $mpdf->WriteHTML($html, 2);
    $mpdf->Output('schedules.pdf', 'I');
    exit();
  }
58698
public function render(\DOMDocument $domDocument)
    {
        $frame = new Frame();
        $frame->setPosition($this->posX, $this->posY)
            ->setSize($this->width, $this->height)
            ->addClasses(["uiContainer", "uiInputMasked"]);

        $quad = new Quad();
        $quad->setSize($this->width * 2, $this->height * 2)
            ->setScale(0.5)
            ->setPosition($this->width / 2, -$this->height / 2)
            ->setStyles('Bgs1', 'BgColorContour')
            ->setAlign("center", "center")
            ->setBackgroundColor('FFFA')
            ->addClass("uiInputMasked")
            ->setScriptEvents(true)
            ->setDataAttributes($this->_dataAttributes)->addClasses($this->_classes);

        $input = new Entry();
        $input->setSize($this->width - 4, $this->height)
            ->setPosition(0, -$this->height / 2)
            ->setDefault($this->default)
            ->setSelectText(true)
            ->setAlign("left", "center2")
            ->setAreaColor("0005")
            ->setAreaFocusColor('000a')
            ->setTextFormat($this->textFormat)
            ->addDataAttribute('type', 'Password')
            ->setName($this->name)
            ->setTextSize(1.5);

        $button = new Button("", Button::TYPE_DEFAULT);
        $button->setTranslate(false)->setText("");
        $button->setSize(4, 4)
            ->addClass("uiMaskedToggle")
            ->setPosition($input->getWidth(), 0);

        $frame->addChild($button);
        $frame->addChild($quad);
        $frame->addChild($input);


        return $frame->render($domDocument);
    }
486425
public static function factory(Document $document, Header $header, $content)
    {
        switch ($header->get('Type')->getContent()) {
            case 'XObject':
                switch ($header->get('Subtype')->getContent()) {
                    case 'Image':
                        return new Image($document, $header, $content);

                    case 'Form':
                        return new Form($document, $header, $content);

                    default:
                        return new PDFObject($document, $header, $content);
                }
                break;

            case 'Pages':
                return new Pages($document, $header, $content);

            case 'Page':
                return new Page($document, $header, $content);

            case 'Encoding':
                return new Encoding($document, $header, $content);

            case 'Font':
                $subtype   = $header->get('Subtype')->getContent();
                $classname = '\Smalot\PdfParser\Font\Font' . $subtype;

                if (class_exists($classname)) {
                    return new $classname($document, $header, $content);
                } else {
                    return new Font($document, $header, $content);
                }

            default:
                return new PDFObject($document, $header, $content);
        }
    }
1207164
public function render(\DOMDocument $domDocument)
    {
        $style3dXml = $domDocument->createElement("style3d");
        $this->checkId();
        if ($this->styleId) {
            $style3dXml->setAttribute("id", $this->styleId);
        }
        if ($this->model) {
            $style3dXml->setAttribute("model", $this->model);
        }
        if ($this->thickness) {
            $style3dXml->setAttribute("thickness", $this->thickness);
        }
        if ($this->color) {
            $style3dXml->setAttribute("color", $this->color);
        }
        if ($this->focusColor) {
            $style3dXml->setAttribute("fcolor", $this->focusColor);
        }
        if ($this->lightColor) {
            $style3dXml->setAttribute("lightcolor", $this->lightColor);
        }
        if ($this->focusLightColor) {
            $style3dXml->setAttribute("flightcolor", $this->focusLightColor);
        }
        if ($this->yOffset) {
            $style3dXml->setAttribute("yoffset", $this->yOffset);
        }
        if ($this->focusYOffset) {
            $style3dXml->setAttribute("fyoffset", $this->focusYOffset);
        }
        if ($this->zOffset) {
            $style3dXml->setAttribute("zoffset", $this->zOffset);
        }
        if ($this->focusZOffset) {
            $style3dXml->setAttribute("fzoffset", $this->focusZOffset);
        }
        return $style3dXml;
    }
235553
static function decorate_root(Frame $root, Dompdf $dompdf)
    {
        $frame = new PageFrameDecorator($root, $dompdf);
        $frame->set_reflower(new PageFrameReflower($frame));
        $root->set_decorator($frame);

        return $frame;
    }