• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP HTML2FPDF类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中HTML2FPDF的典型用法代码示例。如果您正苦于以下问题:PHP HTML2FPDF类的具体用法?PHP HTML2FPDF怎么用?PHP HTML2FPDF使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了HTML2FPDF类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: fopen

<?php

$handle = fopen("invoice_gen.html", 'w+');
if ($handle) {
    if (!fwrite($handle, "<table border=1px>\n\t   <tr> <td>dfddfdfdf</td></tr>\t\n\t</table>")) {
        die("couldn't write to file.");
    }
    echo "success writing to file";
}
require 'html2fpdf.php';
$pdf = new HTML2FPDF();
$pdf->AddPage();
$fp = fopen("invoice_gen.html", "r");
$strContent = fread($fp, filesize("invoice_gen.html"));
fclose($fp);
$pdf->WriteHTML($strContent);
$pdf->Output("invoice_gen.pdf");
echo "PDF file is generated successfully!";
开发者ID:AdoSalkic,项目名称:personal,代码行数:18,代码来源:in.php


示例2: event_espresso_generat_pdf

 function event_espresso_generat_pdf($name = "Invoice", $content)
 {
     require_once 'html2fpdf.php';
     //exit($content);
     $pdf = new HTML2FPDF('P', 'mm', 'Letter');
     $pdf->AddPage();
     $pdf->WriteHTML($content);
     $pdf->Output($name . '.pdf', 'D');
 }
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:9,代码来源:generate_pdf.php


示例3: Pdf_do

 public function Pdf_do($config = array())
 {
     $source_name = $config['name'];
     $task_name = $config['output'];
     require 'htmlofpdf/html2fpdf.php';
     $pdf = new HTML2FPDF();
     $pdf->AddGBFont('GB', 'GB2312');
     $pdf->AddPage();
     $fp = fopen($source_name, "r");
     $strContent = fread($fp, filesize($source_name));
     fclose($fp);
     $pdf->WriteHTML(iconv("UTF-8", "GB2312", $strContent));
     ob_clean();
     $pdf->Output($task_name, true);
 }
开发者ID:coffeehb,项目名称:w3a_SOC,代码行数:15,代码来源:Pdf_smart.php


示例4: pdf

 function pdf()
 {
     exit("deactivated for now...");
     if ($ID = Director::urlParam("ID")) {
         if ($invoice = DataObject::get_one("ShopInvoice", "PublicURL = '" . Convert::Raw2SQL($ID) . "'")) {
             $this->Invoice = $invoice;
             if (!isset($_REQUEST['view'])) {
                 //generate pdf
                 require dirname(__FILE__) . '/Thirdparty/html2fpdf/html2fpdf.php';
                 //to get work HTML2PDF
                 error_reporting(E_ALL ^ (E_NOTICE | E_DEPRECATED));
                 $pdf = new HTML2FPDF();
                 $pdf->AddPage();
                 $pdfPath = $invoice->generatePDF();
                 $outputPath = TEMP_FOLDER . "/shopsystem/";
                 $outputFile = $outputPath . $invoice->PublicURL . ".pdf";
                 $fp = fopen($pdfPath, "r");
                 $strContent = fread($fp, filesize($pdfPath));
                 fclose($fp);
                 $pdf->WriteHTML($strContent);
                 $pdf->Output($outputFile);
                 header('Content-type: application/pdf');
                 header('Content-Disposition: attachment; filename="invoice.pdf"');
                 echo file_get_contents($outputFile);
                 //PDF file is generated successfully!
                 exit;
             }
             if (isset($_REQUEST['remove'])) {
                 //remove invoice from public by generating a new public url
                 $invoice->PublicURL = ShopInvoice::generatePublicURL();
                 $invoice->write();
             }
         }
     }
     return array();
 }
开发者ID:pstaender,项目名称:ShopSystem,代码行数:36,代码来源:ShopInvoice.php


示例5: Create

 function Create()
 {
     $this->content = utf8_decode($this->_ParseHTML($this->content));
     $pdf = new HTML2FPDF();
     $pdf->ShowNOIMG_GIF();
     $pdf->DisplayPreferences('HideWindowUI');
     $pdf->AddPage();
     $pdf->WriteHTML($this->content);
     $pdf->Output(\Cx\Lib\FileSystem\FileSystem::replaceCharacters($this->title));
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:10,代码来源:pdf.class.php


示例6: PDF_html_2_pdf

function PDF_html_2_pdf($data)
{
    global $auth;
    $pdf = new HTML2FPDF();
    $pdf->UseCSS();
    $pdf->UseTableHeader();
    $pdf->AddPage();
    $pdf->WriteHTML(AdjustHTML($data));
    $pdf->Output();
}
开发者ID:BackupTheBerlios,项目名称:ascore,代码行数:10,代码来源:lib_PDF.php


示例7: createPDF

 public function createPDF($url)
 {
     $url = 'http://clients.skiify.com/eximagen/en/boligrafos-plasticos/430-boligrafo-pilot.html';
     require_once '/html2pdf/html2fpdf.php';
     // Create new HTML2PDF class for an A4 page, measurements in mm
     $pdf = new HTML2FPDF('P', 'mm', 'A4');
     $buffer = file_get_contents($url);
     var_dump($buffer);
     // Optional top margin
     $pdf->SetTopMargin(1);
     $pdf->AddPage();
     // Control the x-y position of the html
     $pdf->SetXY(0, 0);
     $pdf->WriteHTML($buffer);
     // The 'D' arg forces the browser to download the file
     $pdf->Output('MyFile.pdf', 'D');
 }
开发者ID:Eximagen,项目名称:3m,代码行数:17,代码来源:converttopdf.php


示例8: FullScreen

        echo $r[unidad_medida];
        ?>
</td>
			<td align="right"><?php 
        echo $r[meta_anp_objetivo_especifico];
        ?>
</td>
			</tr>
	<?php 
    }
}
?>
</table>
<script language="javascript">
FullScreen();
</script>
</body>
</html>
<?php 
if ($_GET[pdf] == 'ok') {
    $htmlbuffer = ob_get_contents();
    ob_end_clean();
    header("Content-type: application/pdf");
    $pdf = new HTML2FPDF('P', 'mm', 'a4');
    $pdf->ubic_css = "../../style.css";
    //agreg mio
    $pdf->DisplayPreferences('HideWindowUI');
    $pdf->AddPage();
    $pdf->WriteHTML($htmlbuffer);
    $pdf->Output('reporte.pdf', 'D');
}
开发者ID:electromanlord,项目名称:sgd,代码行数:31,代码来源:reporte_objetivos_estrategicos_1.php


示例9: getAdvancedReportPDF


//.........这里部分代码省略.........
        $i_isok = !$i_rSet2->EOF;
    }
    if ($i_isok) {
        $i_isok = $i_rSet3 = $g_db->SelectLimit("SELECT * FROM " . $srv_settings['table_prefix'] . "tests WHERE testid=" . $i_rSet2->fields['testid'], 1);
    }
    if ($i_isok) {
        $i_isok = !$i_rSet3->EOF;
    }
    if ($i_isok) {
        $i_isok = $i_rSet3->fields['rtemplateid'] > 0 && ($i_rSet3->fields['test_reportgradecondition'] == 0 || $i_rSet3->fields['test_reportgradecondition'] >= $i_rSet2->fields['gscale_gradeid']);
    }
    if ($i_isok) {
        $i_isok = $i_rSet6 = $g_db->SelectLimit("SELECT * FROM " . $srv_settings['table_prefix'] . "users WHERE id=" . $i_rSet2->fields['id'], 1);
    }
    if ($i_isok) {
        $i_isok = !$i_rSet6->EOF;
    }
    $i_result_detailed_1_items = array();
    $i_result_detailed_2_items = array();
    $i_result_detailed_3_items = array();
    $i_result_detailed_4_items = array();
    if ($i_isok) {
        $i_isok = $i_rSet7 = $g_db->Execute("SELECT * FROM " . $srv_settings['table_prefix'] . "results_answers, " . $srv_settings['table_prefix'] . "questions WHERE resultid=" . $resultid . " AND " . $srv_settings['table_prefix'] . "results_answers.questionid=" . $srv_settings['table_prefix'] . "questions.questionid ORDER BY result_answerid");
    }
    if ($i_isok) {
        $i_questionno = 0;
        while (!$i_rSet7->EOF) {
            $i_questionno++;
            $i_answers = array();
            $i_rSet5 = $g_db->Execute("SELECT answer_text, answer_correct FROM " . $srv_settings['table_prefix'] . "answers WHERE questionid=" . $i_rSet7->fields['questionid'] . " ORDER BY answerid");
            if (!$i_rSet5) {
                showDBError(__FILE__, 5);
            } else {
                $i_answerno = 1;
                while (!$i_rSet5->EOF) {
                    $i_answers[$i_answerno] = $i_rSet5->fields['answer_text'];
                    $i_answers_correct[$i_answerno] = $i_rSet5->fields['answer_correct'];
                    $i_answerno++;
                    $i_rSet5->MoveNext();
                }
                $i_rSet5->Close();
            }
            $i_detailed_correct = $i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_CORRECT;
            $i_result_detailed_3_items[$i_questionno] = $i_questionno . '. ' . getTruncatedHTML($i_rSet7->fields['question_text'], 0);
            $i_result_detailed_1_items[$i_questionno] = $i_result_detailed_3_items[$i_questionno] . '<br />';
            $i_result_detailed_1_items[$i_questionno] .= $lngstr['email_answer_iscorrect'] . ($i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_UNDEFINED ? $lngstr['label_undefined'] : ($i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_CORRECT ? $lngstr['label_yes'] : ($i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_PARTIALLYCORRECT ? $lngstr['label_partially'] : $lngstr['label_no']))) . '<br />';
            $i_result_detailed_1_items[$i_questionno] .= $lngstr['email_answer_points'] . $i_rSet7->fields['result_answer_points'] . '<br />';
            if (!$i_detailed_correct) {
                $i_result_detailed_2_items[$i_questionno] = $i_result_detailed_1_items[$i_questionno];
            }
            $i_result_detailed_3_items[$i_questionno] = '<tr><td>' . $i_result_detailed_3_items[$i_questionno] . '</td></tr>';
            for ($i = 1; $i < $i_answerno; $i++) {
                switch ($i_rSet7->fields['question_type']) {
                    case QUESTION_TYPE_MULTIPLECHOICE:
                    case QUESTION_TYPE_TRUEFALSE:
                        $i_answers_given = (int) $i_rSet7->fields['result_answer_text'];
                        $i_result_detailed_3_items[$i_questionno] .= '<tr><td><img src="images/button-checkbox-' . ($i_answers_correct[$i] ? '2' : ($i == $i_answers_given ? '4' : '0')) . '.gif" width=13 height=13> &nbsp; ' . $i_answers[$i] . '</tr>';
                        break;
                    case QUESTION_TYPE_MULTIPLEANSWER:
                        $i_answers_given = explode(QUESTION_TYPE_MULTIPLEANSWER_BREAK, $i_rSet7->fields['result_answer_text']);
                        $i_result_detailed_3_items[$i_questionno] .= '<tr><td><img src="images/button-checkbox-' . ($i_answers_correct[$i] ? '2' : (in_array($i, $i_answers_given) ? '4' : '0')) . '.gif" width=13 height=13> &nbsp; ' . $i_answers[$i] . '</tr>';
                        break;
                    case QUESTION_TYPE_FILLINTHEBLANK:
                        $i_result_detailed_3_items[$i_questionno] .= '<tr><td>' . nl2br($i_answers[$i]) . '</td></tr>';
                        break;
                }
            }
            if ($i_rSet7->fields['question_type'] == QUESTION_TYPE_ESSAY) {
                $i_result_detailed_3_items[$i_questionno] .= '<tr><td>' . nl2br($i_rSet7->fields['result_answer_text']) . '</td></tr>';
            }
            $i_result_detailed_3_items[$i_questionno] .= '<tr><td>' . $lngstr['email_answer_points'] . $i_rSet7->fields['result_answer_points'] . '</td></tr>';
            if (!$i_detailed_correct) {
                $i_result_detailed_4_items[$i_questionno] = $i_result_detailed_3_items[$i_questionno];
            }
            $i_rSet7->MoveNext();
        }
        $i_rSet7->Close();
        $i_result_detailed_1_text = implode('<br />', $i_result_detailed_1_items);
        $i_result_detailed_2_text = implode('<br />', $i_result_detailed_2_items);
        $i_result_detailed_3_text = '<table cellpadding=0 cellspacing=0 border=0 width="100%">' . implode("\n", $i_result_detailed_3_items) . '</table>';
        $i_result_detailed_4_text = '<table cellpadding=0 cellspacing=0 border=0 width="100%">' . implode("\n", $i_result_detailed_4_items) . '</table>';
        $i_result_detailed_5_text = '';
        $i_result_detailed_6_text = '';
        $i_pdf = eventOnQueryCustomReportPDF();
        if (empty($i_pdf)) {
            $i_pdf = new HTML2FPDF();
            $i_pdf->AddPage();
            $i_pdf->SetFont('Arial', '', 11);
            $i_pdf->SetTextColor(0, 0, 0);
            $g_vars['page']['grade'] = getGradeData($i_rSet2->fields['gscaleid'], $i_rSet2->fields['gscale_gradeid']);
            $g_vars['page']['subjects'] = getTestResultSubjectsData($resultid);
            $i_template_body = getReportTemplate(array('rtemplateid' => $i_rSet3->fields['rtemplateid'], 'username' => $i_rSet6->fields['username'], 'email' => $i_rSet6->fields['email'], 'title' => $i_rSet6->fields['user_title'], 'firstname' => $i_rSet6->fields['user_firstname'], 'lastname' => $i_rSet6->fields['user_lastname'], 'middlename' => $i_rSet6->fields['user_middlename'], 'address' => $i_rSet6->fields['user_address'], 'city' => $i_rSet6->fields['user_city'], 'state' => $i_rSet6->fields['user_state'], 'zip' => $i_rSet6->fields['user_zip'], 'country' => $i_rSet6->fields['user_country'], 'phone' => $i_rSet6->fields['user_phone'], 'fax' => $i_rSet6->fields['user_fax'], 'mobile' => $i_rSet6->fields['user_mobile'], 'pager' => $i_rSet6->fields['user_pager'], 'ipphone' => $i_rSet6->fields['user_ipphone'], 'webpage' => $i_rSet6->fields['user_webpage'], 'icq' => $i_rSet6->fields['user_icq'], 'msn' => $i_rSet6->fields['user_msn'], 'aol' => $i_rSet6->fields['user_aol'], 'gender' => $i_rSet6->fields['user_gender'], 'birthday' => $i_rSet6->fields['user_birthday'], 'husbandwife' => $i_rSet6->fields['user_husbandwife'], 'children' => $i_rSet6->fields['user_children'], 'trainer' => $i_rSet6->fields['user_trainer'], 'photo' => $i_rSet6->fields['user_photo'], 'company' => $i_rSet6->fields['user_company'], 'cposition' => $i_rSet6->fields['user_cposition'], 'department' => $i_rSet6->fields['user_department'], 'coffice' => $i_rSet6->fields['user_coffice'], 'caddress' => $i_rSet6->fields['user_caddress'], 'ccity' => $i_rSet6->fields['user_ccity'], 'cstate' => $i_rSet6->fields['user_cstate'], 'czip' => $i_rSet6->fields['user_czip'], 'ccountry' => $i_rSet6->fields['user_ccountry'], 'cphone' => $i_rSet6->fields['user_cphone'], 'cfax' => $i_rSet6->fields['user_cfax'], 'cmobile' => $i_rSet6->fields['user_cmobile'], 'cpager' => $i_rSet6->fields['user_cpager'], 'cipphone' => $i_rSet6->fields['user_cipphone'], 'cwebpage' => $i_rSet6->fields['user_cwebpage'], 'cphoto' => $i_rSet6->fields['user_cphoto'], 'ufield1' => $i_rSet6->fields['user_ufield1'], 'ufield2' => $i_rSet6->fields['user_ufield2'], 'ufield3' => $i_rSet6->fields['user_ufield3'], 'ufield4' => $i_rSet6->fields['user_ufield4'], 'ufield5' => $i_rSet6->fields['user_ufield5'], 'ufield6' => $i_rSet6->fields['user_ufield6'], 'ufield7' => $i_rSet6->fields['user_ufield7'], 'ufield8' => $i_rSet6->fields['user_ufield8'], 'ufield9' => $i_rSet6->fields['user_ufield9'], 'ufield10' => $i_rSet6->fields['user_ufield10'], 'test_name' => $i_rSet3->fields['test_name'], 'result_id' => $resultid, 'result_date' => getDateLocal($lngstr['language']['date_format_full'], $i_rSet2->fields['result_datestart']), 'result_time_spent' => getTimeFormatted($i_rSet2->fields['result_timespent']), 'result_time_exceeded' => $i_rSet2->fields['result_timeexceeded'] > 0 ? $lngstr['label_yes'] : $lngstr['label_no'], 'result_points_scored' => $i_rSet2->fields['result_points'], 'result_points_possible' => $i_rSet2->fields['result_pointsmax'], 'result_percents' => $i_rSet2->fields['result_pointsmax'] > 0 ? round($i_rSet2->fields['result_points'] * 100 / $i_rSet2->fields['result_pointsmax']) : 0, 'result_grade' => $g_vars['page']['grade']['name'], 'result_grade_feedback' => $g_vars['page']['grade']['feedback'], 'result_subjects' => $g_vars['page']['subjects'], 'result_detailed_1' => $i_result_detailed_1_text, 'result_detailed_2' => $i_result_detailed_2_text, 'result_detailed_3' => $i_result_detailed_3_text, 'result_detailed_4' => $i_result_detailed_4_text, 'result_detailed_5' => $i_result_detailed_5_text, 'result_detailed_6' => $i_result_detailed_6_text));
            $i_pdf->WriteHTML($i_template_body);
        }
    } else {
        $i_pdf = false;
    }
    ob_end_clean();
    return $i_pdf;
}
开发者ID:skyview059,项目名称:e-learning-website,代码行数:101,代码来源:getfile-1.inc.php


示例10: gettext

	  &nbsp;&nbsp;&nbsp;<img src="<?php 
echo Images_Path;
?>
/terminated.jpg">&nbsp; <?php 
echo gettext("Disconnected");
?>
	  
	  </td>
</table>
	

<?php 
if ($exporttype != "pdf") {
    ?>

<?php 
    //include( 'footer.php');
    ?>

<?php 
} else {
    // EXPORT TO PDF
    $html = ob_get_contents();
    // delete output-Buffer
    ob_end_clean();
    $pdf = new HTML2FPDF();
    $pdf->DisplayPreferences('HideWindowUI');
    $pdf->AddPage();
    $pdf->WriteHTML($html);
    $pdf->Output('UnBilledDetails_' . date("d/m/Y-H:i") . '.pdf', 'I');
}
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:A2B_entity_invoice_detail_pdf.php


示例11: DisplayPDF

 function DisplayPDF($smarty, $invoicetype, $template)
 {
     require_once 'pdf-invoices/html2pdf/html2fpdf.php';
     $pdf = new HTML2FPDF();
     $pdf->DisplayPreferences('HideWindowUI');
     $pdf->AddPage();
     $pdf->WriteHTML($this->GetHTML($smarty, $invoicetype, $template));
     // TODO: find a better name
     return $pdf->Output('Invoice_' . date("d/m/Y-H:i") . '.pdf', 'I');
 }
开发者ID:sayemk,项目名称:a2billing,代码行数:10,代码来源:A2B_invoice.php


示例12: getContent


//.........这里部分代码省略.........
    }
    global $sourceFolder;
    global $moduleFolder;
    require_once $sourceFolder . "/" . $moduleFolder . "/" . $moduleType . ".lib.php";
    $page = new $moduleType();
    if (!$page instanceof module) {
        displayerror("The module \"{$moduleType}\" does not implement the inteface module</div>");
        return "";
    }
    $createperms_query = " SELECT * FROM " . MYSQL_DATABASE_PREFIX . "permissionlist where perm_action = 'create' AND page_module = '" . $moduleType . "'";
    $createperms_result = mysql_query($createperms_query);
    if (mysql_num_rows($createperms_result) < 1) {
        displayerror("The action \"create\" does not exist in the module \"{$moduleType}\"</div>");
        return "";
    }
    $availableperms_query = "SELECT * FROM " . MYSQL_DATABASE_PREFIX . "permissionlist where perm_action != 'create' AND page_module = '" . $moduleType . "'";
    $availableperms_result = mysql_query($availableperms_query);
    $permlist = array();
    while ($value = mysql_fetch_assoc($availableperms_result)) {
        array_push($permlist, $value['perm_action']);
    }
    array_push($permlist, "view");
    $class_methods = get_class_methods($moduleType);
    foreach ($permlist as $perm) {
        if (!in_array("action" . ucfirst($perm), $class_methods)) {
            displayerror("The action \"{$perm}\" does not exist in the module \"{$moduleType}\"</div>");
            return "";
        }
    }
    if ($action == "pdf") {
        if (isset($_GET['depth'])) {
            $depth = $_GET['depth'];
        } else {
            $depth = 0;
        }
        if (!is_numeric($depth)) {
            $depth = 0;
        }
        global $TITLE;
        global $sourceFolder;
        require_once "{$sourceFolder}/modules/pdf/html2fpdf.php";
        $pdf = new HTML2FPDF();
        $pdf->setModuleComponentId($moduleComponentId);
        $pdf->AddPage();
        $pdf->WriteHTML($page->getHtml($userId, $moduleComponentId, "view"));
        $cp = array();
        $j = 0;
        if ($depth == -1) {
            $cp = child($pageId, $userId, $depth);
            if ($cp[0][0]) {
                for ($i = 0; $cp[$i][0] != NULL; $i++) {
                    require_once $sourceFolder . "/" . $moduleFolder . "/" . $cp[$i][2] . ".lib.php";
                    $page1 = new $cp[$i][2]();
                    $modCompId = $cp[$i][5];
                    $pdf->setModuleComponentId($modCompId);
                    $pdf->AddPage();
                    $pdf->WriteHTML($page1->getHtml($userId, $modCompId, "view"));
                }
            }
        } else {
            if ($depth > 0) {
                $cp = child($pageId, $userId, $depth);
                --$depth;
                while ($depth > 0) {
                    $count = count($cp);
                    for ($j; $j < $count; $j++) {
                        $cp = array_merge((array) $cp, (array) child($cp[$j][0], $userId, $depth));
                    }
                    --$depth;
                }
                if ($cp[0][0]) {
                    for ($i = 0; isset($cp[$i]); $i++) {
                        require_once $sourceFolder . "/" . $moduleFolder . "/" . $cp[$i][2] . ".lib.php";
                        $page1 = new $cp[$i][2]();
                        $modCompId = $cp[$i][5];
                        $pdf->setModuleComponentId($modCompId);
                        $pdf->AddPage();
                        $pdf->WriteHTML($page1->getHtml($userId, $modCompId, "view"));
                    }
                }
            }
        }
        $filePath = $sourceFolder . "/uploads/temp/" . $TITLE . ".pdf";
        while (file_exists($filePath)) {
            $filePath = $sourceFolder . "/uploads/temp/" . $TITLE . "-" . rand() . ".pdf";
        }
        $pdf->Output($filePath);
        header("Pragma: public");
        header("Expires: 0");
        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
        header("Cache-Control: private", false);
        header("Content-Type: application/pdf");
        header("Content-Disposition: attachment; filename=\"" . basename($filePath) . "\";");
        header("Content-Transfer-Encoding: binary");
        header("Content-Length: " . filesize($filePath));
        @readfile("{$filePath}");
        unlink($filePath);
    }
    return $page->getHtml($userId, $moduleComponentId, $action);
}
开发者ID:rubulh,项目名称:pragyan,代码行数:101,代码来源:content.lib.php


示例13: str_pad

              else*/
            if ($lessonIndex !== false) {
                $html .= "bgcolor=\"#" . str_pad(dechex(isset($colors[$bookings[$lessonIndex][0]][0]) ? $colors[$bookings[$lessonIndex][0]][0] : 200), 2, "0", STR_PAD_LEFT) . str_pad(dechex(isset($colors[$bookings[$lessonIndex][0]][1]) ? $colors[$bookings[$lessonIndex][0]][1] : 200), 2, "0", STR_PAD_LEFT) . str_pad(dechex(isset($colors[$bookings[$lessonIndex][0]][2]) ? $colors[$bookings[$lessonIndex][0]][2] : 200), 2, "0", STR_PAD_LEFT) . "\"";
            }
            $html .= ">";
            if ($lessonIndex !== false) {
                $html .= "<font color=\"#" . str_pad(dechex(getSingleContrastColor(isset($colors[$bookings[$lessonIndex][0]][0]) ? $colors[$bookings[$lessonIndex][0]][0] : 200)), 2, "0", STR_PAD_LEFT) . str_pad(dechex(getSingleContrastColor(isset($colors[$bookings[$lessonIndex][0]][1]) ? $colors[$bookings[$lessonIndex][0]][1] : 200)), 2, "0", STR_PAD_LEFT) . str_pad(dechex(getSingleContrastColor(isset($colors[$bookings[$lessonIndex][0]][2]) ? $colors[$bookings[$lessonIndex][0]][2] : 200)), 2, "0", STR_PAD_LEFT) . "\">";
            }
            if ($lessonIndex !== false) {
                $html .= $bookings[$lessonIndex][2];
            } else {
                $html .= "&nbsp;";
            }
            if ($lessonIndex !== false) {
                $html .= '</font>';
            }
            $html .= "</td>";
        }
        $html .= "</tr>";
    }
    $html .= '</table>';
}
$html .= '</body>
</html>';
$pdf = new HTML2FPDF("L");
$pdf->AddPage();
$pdf->WriteHTML($html);
//echo $html;
$pdf->Output();
//Outputs on browser screen
//$pdf->Output('antrag.pdf'); // save document on server
开发者ID:BackupTheBerlios,项目名称:unisched-svn,代码行数:31,代码来源:print.php


示例14: array

{  
    $farr = array(  
        "/\s+/", //过滤多余空白  
         //过滤 <script>等可能引入恶意内容或恶意改变显示布局的代码,如果不需要插入flash等,还可以加入<object>的过滤  
        "/<(\/?)(script|i?frame|style|html|body|title|link|meta|INPUT|A|img|\?|\%)([^>]*?)>/isU", 
        "/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU",//过滤javascript的on事件  
   );  
   $tarr = array(  
        " ",  
        "",//如果要直接清除不安全的标签,这里可以留空  
        "",
   );  
  $str = preg_replace( $farr,$tarr,$str);  
   return $str;  
}
$pdf=new HTML2FPDF();
$pdf->AddGBFont('GB','仿宋_GB2312');
$pdf->SetFontSize('8');
$pdf->AddPage();
$fp = fopen("sample.html","r");
$strContent = fread($fp, filesize("sample.html"));
fclose($fp);
$msg=urldecode($_POST['userdefine']);
$msg=str_replace("class=TableBlock", "border=1", $msg);
$msg=str_replace("class=TableHeader", "bgcolor=#DDDDDD", $msg);
$msg=str_replace("class=TableContent", "bgcolor=#EEEEEE", $msg);
$msg=str_replace("class=TableDatat", "bgcolor=#FFFFFF", $msg);
$msg=str_replace("<tr>", "<TR>", $msg);
$msg=str_replace("</tr>", "</TR>", $msg);
$msg=str_replace("<td", "<TD", $msg);
$msg=str_replace("</td>", "</TD>", $msg);
开发者ID:shesai0519,项目名称:sunshineCRM,代码行数:31,代码来源:test.php


示例15: load

<?php

function load($url)
{
    curl_setopt($curld, CURLOPT_URL, $url);
    curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);
    $output = curl_exec($curld);
    curl_close($curld);
    return $output;
}
ob_start();
echo load("http://localhost/nuker/");
$htmlbuffer = ob_get_contents();
ob_end_clean();
require '../html2fpdf/html2fpdf.php';
$pdf = new HTML2FPDF();
$pdf->AddPage();
$pdf->WriteHTML($htmlbuffer);
$pdf->Output('doc.pdf', 'I');
开发者ID:hendrilara,项目名称:sispulsa-ajax,代码行数:19,代码来源:index5.php


示例16: strtoupper

                                                    <tr class="fil">
                                                        <td><span>5.2 PRESUPUESTO DEL PROYECTO : <?php 
    echo strtoupper(utf8_encode($value[39]));
    ?>
</span> </td>
                                                      
                                                    </tr>
                                                    <tr class="fil">
                                                        <td><span>5.3 FINANCIAMIENTO : <?php 
    echo strtoupper(utf8_encode($value[41]));
    ?>
 </strong></span> </td>
                                                       
                                                    </tr>
                             <?php 
}
?>
                        </tbody></table>
     </div> 

<?php 
$content = ob_get_clean();
$pdf = new HTML2FPDF('P', 'mm', 'A4', 'UTF-8');
$pdf->UseCSS($opt == true);
$pdf->AddPage();
$pdf->WriteHTML($content);
$pdf->ReadCSS($content);
$pdf->Output('proyecto.pdf');
?>

开发者ID:ewo1991,项目名称:sisacreditacion,代码行数:29,代码来源:_Pdf.php


示例17: array

}
// this query is for Clientorder's components list
$fields = array('name', 'type', 'number', 'paper');
$query = "SELECT name, type, number, paper FROM `clientorders_components` WHERE parent_id='" . $focus->id . "' AND deleted=0";
$result = $focus->db->query($query, true, "Error filling layout fields: ");
while (($row = $focus->db->fetchByAssoc($result)) != null) {
    foreach ($fields as $field) {
        $data[$field] = $row[$field];
    }
    $list[] = $data;
}
//////////////
$xtpl = new XTemplate("modules/{$currentModule}/CreatePDF.html");
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$pdf = new HTML2FPDF();
$xtpl->assign("HEADER", $pdf->headerPDF());
$xtpl->assign("FOOTER", $pdf->footerPDF());
$xtpl->assign("ROWS", $pdf->CompRows($list));
$xtpl->parse("main.row1");
//Assign layout attributes
$xtpl->assign("LABEL_COLOR", $pdfColors["label"]);
$xtpl->assign("FIELD_COLOR", $pdfColors["field"]);
$xtpl->assign("colspan", count($fields));
$xtpl->assign("fSize", $pdfFontSize["default"]);
$xtpl->assign("headingFontSize", $pdfFontSize["heading"]);
$xtpl->assign("headingColor", $pdfColors["heading"]);
$xtpl->assign("titleColor", $pdfColors["headerFld"]);
$xtpl->assign("firstCol", "20%");
$xtpl->assign("secCol", "30%");
//Line divider attributes
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:CreatePDF.php


示例18: ob_get_contents

<HEAD><TITLE>test</TITLE></HEAD>
<BODY>

   <a href=>est</a>
   	   <table border=1><tr><td>1</td></tr><tr><td>1</td></tr><tr><td>1</td></tr><tr><td>1</td></tr>
   	   </table>

</BODY>
</HTML>

<?php 
$html = ob_get_contents();
ob_end_clean();
// PDFの書式設定
$pdf = new HTML2FPDF("l", "mm", "A4");
$pdf->Open();
$pdf->SetCompression(false);
$pdf->SetDisplayMode("real");
$pdf->UseCSS();
$pdf->UsePRE();
$pdf->setBasePath("http://google.com");
$pdf->AddPage();
//ファイル情報
$pdf->SetAuthor("Kazuhiko HiroseKazuhiko HiroseKazuhiko HiroseKazuhiko HiroseKazuhiko HiroseKazuhiko HiroseKazuhiko HiroseKazuhiko Hirose");
$pdf->Bookmark("BookmarkBookmarkBookmarkBookmarkBookmarkBookmarkBookmarkBookmarkBookmarkBookmarkBookmark");
$pdf->SetTitle("SetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitle");
$pdf->SetCreator("SetCreatorSetCreatorSetCreatorSetCreatorSetCreatorSetCreatorSetCreatorSetCreatorSetCreatorSetCreator");
// 本文
$pdf->SetMargins(10, 10);
$pdf->DisplayPreferences('HideWindowUI');
开发者ID:tranngocthang89,项目名称:basephpmvc,代码行数:30,代码来源:test.php


示例19: toggleDebugDiv

    if ($pfDebug) {
        echo @"\n<style type=\"text/css\">\n#debugdiv {\nfloat: none;\nposition: absolute;\n/*top: 120;\nleft: 500;*/\ndisplay: none;\n}\n</style>\n<script language=\"javascript\">\nfunction toggleDebugDiv() {\n  var dbgdiv = document.getElementById('debugdiv'); \n  var displ = dbgdiv.style.display;\n  if ((displ == 'none') || (displ == '')) {\n    dbgdiv.style.display = 'block';\n  } else {\n    dbgdiv.style.display = 'none'; \n  }\n}\n</script>\n";
        echo '<div style="text-align: left;"><a href="javascript: toggleDebugDiv();" />DEBUG:</a></div><div id="debugdiv"><table style="background-color: aliceblue; padding: 8pt; border: thick dotted khaki; width: 700px; margin-top: 24pt;"><tr><td><h2>performs.php</h2></td></tr><tr><td>';
        $tabs = new mosTabs(0);
        //startTab (joomla.php line 4318 version 1.0.11) only ever adds tabs to tabPane1 ...
        $tabs->startPane("session");
        report_env($tabs, 1);
        // $tabs->startTab("MAKE", 'session');
    }
    /*============================================================================*/
    $strResult = $objMyForm->make();
    if ($pfDebug) {
        $tabs->endTab();
        $tabs->endPane();
    }
    if ($printpdf) {
        $pdf = new HTML2FPDF();
        $pdf->DisplayPreferences('HideWindowUI');
        $pdf->AddPage();
        $pdf->WriteHTML($strResult);
        ob_end_clean();
        $pdf->Output('doc.pdf', 'D');
    } else {
        echo $strResult;
    }
}
function die2($dietxt)
{
    global $pfDebug;
    die($dietxt);
}
开发者ID:allenahner,项目名称:mizzou,代码行数:31,代码来源:performsPreview.php


示例20: include

<?php

/*    ob_start();
    include("../../view/template/receipt.php");
    $content = ob_get_clean();*/
$htmlfile = "http://localhost/source/view/template/receipt.php";
require "html2pdf.class.php";
try {
    $html2pdf = new HTML2FPDF('P', 'mm', 'Letter');
    //        $fp = fopen("../../view/template/receipt.php", "r");
    $contents = file_get_contents($htmlfile);
    //        fclose($fp);
    //        echo $contents;
    $html2pdf->WriteHTML($contents);
    $html2pdf->Output('receipt.pdf');
} catch (HTML2PDF_exception $e) {
    echo $e;
    exit;
}
开发者ID:anurag95,项目名称:CoWork,代码行数:19,代码来源:receipt.php



注:本文中的HTML2FPDF类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP HTML2PDF类代码示例发布时间:2022-05-23
下一篇:
PHP HTML类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap