kartik\mpdf\Pdf::writePdfAttachement PHP Method

writePdfAttachement() private method

appends the given attachement to the generated PDF
private writePdfAttachement ( mPDF $api, String $attachement )
$api mPDF
$attachement String
    private function writePdfAttachement($api, $attachement)
    {
        try {
            $pageCount = $api->SetSourceFile($attachement);
        } catch (\MpdfException $e) {
            $pageCount = 0;
        }
        for ($i = 1; $i <= $pageCount; $i++) {
            $api->AddPage();
            $templateId = $api->ImportPage($i);
            $api->UseTemplate($templateId);
        }
    }