src/Pdf/PdfWriter.php
public function prepare(): Mpdf
    {
        $this->pdf = $this->getPdf();

        // set the custom pdf template
        if (null !== $this->getTemplate() && file_exists($this->getTemplate())) {
            $this->pdf->SetImportUse();

            $pageCount = $this->pdf->SetSourceFile($this->getTemplate());
            $tplIdx = $this->pdf->ImportPage($pageCount);
            $this->pdf->UseTemplate($tplIdx);
            $this->pdf->UseTemplate($tplIdx);
        }

        $this->pdf->WriteHTML($this->html);

        $this->isPrepared = true;

        return $this->pdf;
    }
public function prepare(): Mpdf
    {
        $this->pdf = $this->getPdf();

        // set the custom pdf template
        if (null !== $this->getTemplate() && file_exists($this->getTemplate())) {
            $this->pdf->SetImportUse();

            $pageCount = $this->pdf->SetSourceFile($this->getTemplate());
            $tplIdx = $this->pdf->ImportPage($pageCount);
            $this->pdf->UseTemplate($tplIdx);
            $this->pdf->UseTemplate($tplIdx);
        }

        $this->pdf->WriteHTML($this->html);

        $this->isPrepared = true;

        return $this->pdf;
    }
public function prepare ( ) : Mpdf { $ this -> pdf = $ this -> getPdf ( ) ; // set the custom pdf template if ( null !== $ this -> getTemplate ( ) && file_exists ( $ this -> getTemplate ( ) ) ) { $ this -> pdf -> SetImportUse ( ) ; $ pageCount = $ this -> pdf -> SetSourceFile ( $ this -> getTemplate ( ) ) ; $ tplIdx = $ this -> pdf -> ImportPage ( $ pageCount ) ; $ this -> pdf -> UseTemplate ( $ tplIdx ) ; $ this -> pdf -> UseTemplate ( $ tplIdx ) ; } $ this -> pdf -> WriteHTML ( $ this -> html ) ; $ this -> isPrepared = true ; return $ this -> pdf ; }
Prepare the current mpdf object.

@return Mpdf
Prepare the current mpdf object .