本文整理汇总了PHP中FPDI::SetFont方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDI::SetFont方法的具体用法?PHP FPDI::SetFont怎么用?PHP FPDI::SetFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPDI
的用法示例。
在下文中一共展示了FPDI::SetFont方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generate_philosophy_certificate
function generate_philosophy_certificate($confirmation, $form, $entry, $ajax)
{
// print_r( $entry ); die;
if ($entry['gquiz_is_pass']) {
$upload_dir = wp_upload_dir();
// initiate FPDI
$pdf = new FPDI();
// set the sourcefile
$pdf->setSourceFile(get_template_directory() . '/library/certificate.pdf');
// import page 1
$tplIdx = $pdf->importPage(1);
// get the width and height of the template
$specs = $pdf->getTemplateSize($tplIdx);
// add a page
$pdf->AddPage("L", array($specs['w'], $specs['h']));
// use the imported page as the template
$pdf->useTemplate($tplIdx, 0, 0);
// now write some text above the imported page
$pdf->SetY(101);
$pdf->SetFont("dejavuserifbi", 'I', 35);
$pdf->SetTextColor(0, 54, 99);
$text = $entry['2.3'] . " " . $entry['2.6'];
$pdf->MultiCell(260, 40, $text, 0, 'C');
// now write some text above the imported page
$pdf->SetY(165);
$pdf->SetFont("dejavuserifbi", 'I', 22);
$pdf->SetTextColor(0, 54, 99);
$text = date('F j, Y');
$pdf->MultiCell(260, 22, $text, 0, 'C');
// save the pdf out to file
$pdf->Output($upload_dir['basedir'] . '/certificates/' . $entry['id'] . '.pdf', 'F');
}
return array('redirect' => '/philosophy-results/?id=' . $entry['id']);
}
示例2: generate_mitgliedsbescheinigung
function generate_mitgliedsbescheinigung($titleAndName, $strasse, $plz, $ort, $land, $jahr, $vorstand, $datum)
{
// initiate FPDI
$pdf = new FPDI();
// add a page
$pdf->AddPage();
// set the source file
$pdf->setSourceFile(HOME_DIRECTORY . 'alumpiHP_libraries/Mitgliedsbestaetigung_blank.pdf');
// import page 1
$tplIdx = $pdf->importPage(1);
// use the imported page and place it at position 0,0 with a width of 210 mm (full page)
$pdf->useTemplate($tplIdx, 0, 0, 210);
// add the font DejaVu
$pdf->AddFont('DejaVuSans', '', 'DejaVuSans.ttf', true);
$pdf->AddFont('DejaVuSans-Bold', '', 'DejaVuSans-Bold.ttf', true);
// text settings
$pdf->SetTextColor(0, 0, 0);
// add address of the member
$addressString = $titleAndName . "\n";
$addressString .= $strasse . "\n";
$addressString .= $plz . " " . $ort . "\n";
$addressString .= $land;
$pdf->SetFont('DejaVuSans');
$pdf->SetFontSize(12);
$pdf->SetXY(20, 23);
$pdf->Multicell(80, 6, $addressString);
//add heading
$headingString = "Mitgliedsbescheinigung " . $jahr;
$pdf->SetFont('DejaVuSans-Bold');
$pdf->SetFontSize(16);
$pdf->SetXY(20, 80);
$pdf->Multicell(170, 6, $headingString);
// add main text
$textString = "Hiermit wird bestätigt, dass " . $titleAndName . " im Kalenderjahr " . $jahr;
$textString .= " ordentliches Mitglied des Absolventen- und Förderverein MPI Uni Bayreuth e.V. (aluMPI) ist.\n";
$textString .= "\n";
$pdf->SetFont('DejaVuSans');
$pdf->SetFontSize(12);
$pdf->SetXY(20, 100);
$pdf->Multicell(170, 6, $textString);
// add signature text
$signatureString = "Absolventen- und Förderverein MPI Uni Bayreuth e.V.\n";
$signatureString .= "1. Vorstand: " . $vorstand . "\n";
$pdf->SetXY(20, 140);
$pdf->Multicell(170, 6, $signatureString);
// add signature
$pdf->Image(HOME_DIRECTORY . 'alumpiHP_libraries/unterschrift_krinninger.png', 20, 155, 50);
// add place and date
$dateString = "Bayreuth, " . $datum;
$pdf->SetXY(20, 180);
$pdf->Multicell(170, 6, $dateString);
ob_clean();
$pdf->Output();
}
示例3: runProcessStep
public function runProcessStep($dokument)
{
$file = $dokument->getLatestRevision()->getFile();
$extension = array_pop(explode(".", $file->getExportFilename()));
#$this->ziphandler->addFile($file->getAbsoluteFilename(), $file->getExportFilename());
// Print Metainfo for PDFs
if (strtolower($extension) == "pdf") {
try {
$fpdf = new FPDI();
$pagecount = $fpdf->setSourceFile($file->getAbsoluteFilename());
$fpdf->SetMargins(0, 0, 0);
$fpdf->SetFont('Courier', '', 8);
$fpdf->SetTextColor(0, 0, 0);
$documentSize = null;
for ($i = 0; $i < $pagecount; $i++) {
$string = $dokument->getLatestRevision()->getIdentifier() . " (Seite " . ($i + 1) . " von " . $pagecount . ", Revision " . $dokument->getLatestRevision()->getRevisionID() . ")";
$fpdf->AddPage();
$tpl = $fpdf->importPage($i + 1);
$size = $fpdf->getTemplateSize($tpl);
// First Page defines documentSize
if ($documentSize === null) {
$documentSize = $size;
}
// Center Template on Document
$fpdf->useTemplate($tpl, intval(($documentSize["w"] - $size["w"]) / 2), intval(($documentSize["h"] - $size["h"]) / 2), 0, 0, true);
$fpdf->Text(intval($documentSize["w"]) - 10 - $fpdf->GetStringWidth($string), 5, $string);
}
$this->ziphandler->addFromString($dokument->getLatestRevision()->getIdentifier() . "." . $extension, $fpdf->Output("", "S"));
} catch (Exception $e) {
$this->ziphandler->addFile($file->getAbsoluteFilename(), $dokument->getLatestRevision()->getIdentifier() . "." . $extension);
}
} else {
$this->ziphandler->addFile($file->getAbsoluteFilename(), $dokument->getLatestRevision()->getIdentifier() . "." . $extension);
}
}
示例4: listAction
public function listAction()
{
$receipt = new \FPDI();
// PDFの余白(上左右)を設定
$receipt->SetMargins(0, 0, 0);
// ヘッダーの出力を無効化
$receipt->setPrintHeader(false);
// フッターの出力を無効化
$receipt->setPrintFooter(false);
// フォントを登録
$fontPathRegular = $this->getLibPath() . '/tcpdf/fonts/migmix-2p-regular.ttf';
// $regularFont = $receipt->addTTFfont($fontPathRegular, '', '', 32);
$font = new TCPDF_FONTS();
$regularFont = $font->addTTFfont($fontPathRegular);
$fontPathBold = $this->getLibPath() . '/tcpdf/fonts/migmix-2p-bold.ttf';
// $boldFont = $receipt->addTTFfont($fontPathBold, '', '', 32);
$font = new TCPDF_FONTS();
$boldFont = $font->addTTFfont($fontPathBold);
// ページを追加
$receipt->AddPage();
// テンプレートを読み込み
// $receipt->setSourceFile($this->getLibPath() . '/tcpdf/tpl/receipt.pdf');
// $receipt->setSourceFile($this->getLibPath() . '/tcpdf/tpl/template.pdf');
// $receipt->setSourceFile($this->getLibPath() . '/tcpdf/tpl/w01_1.pdf');
$receipt->setSourceFile($this->getLibPath() . '/tcpdf/tpl/senijiten.pdf');
// 読み込んだPDFの1ページ目のインデックスを取得
$tplIdx = $receipt->importPage(1);
// 読み込んだPDFの1ページ目をテンプレートとして使用
$receipt->useTemplate($tplIdx, null, null, null, null, true);
// 書き込む文字列のフォントを指定
$receipt->SetFont($regularFont, '', 11);
// 書き込む文字列の文字色を指定
$receipt->SetTextColor(0, 0, 255);
// X : 42mm / Y : 108mm の位置に
$receipt->SetXY(59, 248);
// 文字列を書き込む
$receipt->Write(0, isset($_POST['name']) ? $_POST['name'] . 'さん' : '名無しさん');
/* $response = new Response(
// Output関数の第一引数にはファイル名、第二引数には出力タイプを指定する
// 今回は文字列で返してほしいので、ファイル名はnull、出力タイプは S = String を選択する
$receipt->Output(null, 'S'),
200,
array('content-type' => 'application/pdf')
);
// レスポンスヘッダーにContent-Dispositionをセットし、ファイル名をreceipt.pdfに指定
$response->headers->set('Content-Disposition', 'attachment; filename="receipt.pdf"');
return $response;
*/
// $receipt->
$receipt->output('newpdf.pdf', 'I');
}
示例5: renderPDF
function renderPDF($id,$mode)
{
$pdf = new FPDI();
$db_catalogue_pages = new catalogue_pages;
$db_catalogue_pages->get_one_catalogue_pages($id);
$db_catalogue_pages->load();
$template_id = $db_catalogue_pages->get_pag_template();
$template = new catalogue_templates;
$template->getOne($template_id);
$template->load();
$pdf->addPage("Landscape","Letter");
$db_catalogue_objects = new catalogue_objects;
$db_catalogue_objects->get_all($id);
$pdf->SetFont('Arial','',14);
$pdf->Image("pdftemplates/".$template->get_tem_file().".jpg",0,0);
while($db_catalogue_objects->load())
{
$var = explode("_",$db_catalogue_objects->get_obj_var());
if($var[0] == "image")
{
if(file_exists($db_catalogue_objects->field->obj_image)) $pdf->Image($db_catalogue_objects->field->obj_image,($db_catalogue_objects->field->obj_posx*0.353),($db_catalogue_objects->field->obj_posy*0.353),"50","50");
}
$pdf->SetXY($db_catalogue_objects->field->obj_posx*0.353,($db_catalogue_objects->field->obj_posy*0.35) + 60);
$pdf->Write(5,$db_catalogue_objects->field->obj_text);
}
$db_catalogue_objects->close();
$db_catalogue_pages->close();
//if($mode=="I") $pdf->Output("page_".$id.".pdf", "I");
//else $pdf->Output("pages/page_".$id.".pdf", "F");
$pdf->Output("pages/page_".$id.".pdf", "F");
}
示例6: execute
protected function execute(InputInterface $input, OutputInterface $output)
{
$id = $input->getArgument('id');
$pdffile = $input->getArgument('pdf');
$em = $this->getContainer()->get('doctrine');
$tab = $this->csv($pdffile);
$template = $em->getRepository('PrintBundle:Template')->find($id);
$path = $this->getContainer()->get('kernel')->getRootDir() . '/../web/uploads/pdf/' . $template->getPdffile();
$width = $template->getWidth();
$height = $template->getHeight();
$orientation = $height > $width ? 'P' : 'L';
$custom_layout = array($width, $height);
$i = 1;
foreach ($tab as $key => $value) {
$pdf = new \FPDI($orientation, 'mm', $custom_layout, true, 'UTF-8', false);
$pdf->setPageOrientation($orientation);
$pdf->SetMargins(PDF_MARGIN_LEFT, 40, PDF_MARGIN_RIGHT);
$pdf->SetAutoPageBreak(true, 40);
$pdf->setFontSubsetting(false);
// add a page
$pdf->AddPage($orientation);
$pdf->setSourceFile($path);
$_tplIdx = $pdf->importPage(1);
$size = $pdf->useTemplate($_tplIdx, 0, 0, $width, true);
foreach ($template->getChildactivity() as $opt) {
$pdf->SetXY($opt->getX(), $opt->getY());
$pdf->SetFont($opt->getFont(), '', $opt->getFontsize() * 2);
// echo $opt->getFontsize()."\n";
$pdf->Cell($opt->getWidth(), $opt->getHeight(), $value[$opt->getName()]);
}
//$pdf->Cell(0, $size['h'], 'TCPDF and FPDI');
// echo $template->getId();
$pdf->Output($this->getContainer()->get('kernel')->getRootDir() . '/../web/folder/pdf' . $template->getId() . "-{$i}.pdf", 'F');
$i++;
}
}
示例7: trim
function decrypt_text($value, $key1, $key2)
{
if (!$value || !$key1 || !$key2) {
return false;
}
$crypttext = base64_decode($value);
$decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key1, $crypttext, MCRYPT_MODE_ECB, $key2);
return trim($decrypttext);
}
//loads the data from the table into the array $row
$row = $results->fetchArray();
//print var_dump($row);
//exit();
//instructions for where and how to place each piece of information on the pdf form
//Name
$pdf->SetFont('Arial');
$pdf->SetXY(36, 35.5);
$pdf->Write(10, $row["FIRST_NAME"] . " " . $row["LAST_NAME"]);
//Phone
$pdf->SetXY(147, 35.5);
$pdf->Write(10, $row["HOME_PHONE"]);
//Cell Phone
if (strlen($row["CELL_PHONE"]) > 3) {
$pdf->SetXY(142, 42.2);
$pdf->Write(10, $row["CELL_PHONE"]);
}
//Street Address
$pdf->SetXY(27, 42.2);
$pdf->Write(10, $row["ADDRESS"]);
//Email
$pdf->SetXY(136, 48.5);
示例8: valorSql
$CODBARRASCLAVE = valorSql("SELECT ARCHIVO.GET_CODBARRASCLAVE('OPT', :op ,'','','') FROM DUAL", "", $params);
//--------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------
$pdf = new FPDI();
$pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/varios/tesoreria/templates/reporte_reemplazo.pdf");
$pdf->AddPage();
$tplIdx = $pdf->importPage(1);
$pdf->SetAuthor('ART');
$pdf->useTemplate($tplIdx);
// Dibujo la cabecera..
$pdf->SetFont("Arial", "", 16);
$pdf->Text(75, 15, $rowCabecera["OP"]);
$pdf->SetFont("Arial", "", 11);
$pdf->Text(40, 21, $rowCabecera["BENEFICIARIO"]);
$pdf->SetFont("Arial", "", 7);
$pdf->Text(32, 34, $rowCabecera2["VENDOR_NAME"]);
//---------------------------------------------------------------------------
$pdf->Text(32, 38, $rowCabecera2["ADDRESS_LINE1"]);
$pdf->Text(32, 41, $rowCabecera2["ADDRESS_LINE2"]);
$pdf->Text(32, 44, $rowCabecera2["CITY"]);
$pdf->Text(32, 47, $rowCabecera2["STATE"]);
$pdf->Text(33, 57, $rowCabecera2["ZIP"]);
//---------------------------------------------------------------------------
$pdf->Text(146, 47, $rowCabecera["FECHA_OP"]);
示例9: generatePatientTrendReport
//.........这里部分代码省略.........
$count++;
$preServiceTypeName = $row['ServiceTypeName'];
$count = 0;
while ($count < count($month_list)) {
$output2[] = null;
$count++;
}
$dataMonthYear = $monthQuarterList[$row['MonthId']] . ' ' . $row['Year'];
$count = 0;
while ($count < count($month_list)) {
if ($month_list[$count] == $dataMonthYear) {
$output2[$count] = $row['TotalPatient'];
}
$count++;
}
$tmpServiceTypeId = $row['ServiceTypeId'];
} else {
$dataMonthYear = $monthQuarterList[$row['MonthId']] . ' ' . $row['Year'];
$count = 0;
while ($count < count($month_list)) {
if ($month_list[$count] == $dataMonthYear) {
$output2[$count] = $row['TotalPatient'];
}
$count++;
}
$tmpServiceTypeId = $row['ServiceTypeId'];
}
}
array_unshift($output2, $countServiceType, $preServiceTypeName);
$aData[] = $output2;
//print_r($month_list);
$col = '<tr><th width="20" align="center"><b>SL</b></th>';
$col .= '<th width="35" align="left"><b>' . $gTEXT['Patient Type'] . '</b></th>';
$f = 0;
for ($f = 0; $f < count($month_list); $f++) {
$col .= '<th width="30" align="right"><b>' . $month_list[$f] . '</b></th>';
}
$col .= '</tr>';
$p = 0;
for ($p = 0; $p < count($aData); $p++) {
$col .= '<tr>';
for ($i = 0; $i < count($aData[$p]); $i++) {
$col .= '<td>' . $aData[$p][$i] . '</td>';
}
$col .= '</tr>';
}
$i = 1;
/* $col = '<tr><th width="38" align="center"><b>SL</b></th>';
$col.= '<th width="38" align="left"><b>'.$gTEXT['Patient Type'].'</b></th>';
$f=0;
for($f = 0; $f<count($rmonth_name); $f++){
$col.= '<th width="38" align="right"><b>'.$rmonth_name[$f].'</b></th>';
}
$col.='</tr><tr>';
$x=0;
for($x = 0; $x<count($art); $x++){
$col.= '<td width="38" align="right"><b>'.$art[$x].'</b></td>';
}
$col.='</tr><tr>';
$x=0;
for($x = 0; $x<count($rtk); $x++){
$col.= '<td width="38" align="right"><b>'.$rtk[$x].'</b></td>';
}
$col.='</tr><tr>';
$x=0;
for($x = 0; $x<count($pmtct); $x++){
$col.= '<td width="38" align="right"><b>'.$pmtct[$x].'</b></td>';
}
$col.='</tr>'; */
$html_head = "<span><b>" . $gTEXT['Patient Trend Time Series Data List'] . "</b></span>";
$pdf->SetFont('dejavusans', '', 9);
$pdf->writeHTMLCell(0, 0, 17, 125, $html_head, '', 0, 0, false, 'L', true);
$html = '
<!-- EXAMPLE OF CSS STYLE -->
<style>
td{
height: 6px;
line-height:3px;
}
</style>
<body>
<table width="550px" border="0.5" style="margin:0px auto;">' . $col . '</table></body>';
$pdf->SetFont('dejavusans', '', 7);
$pdf->writeHTMLCell(0, 0, 15, 140, $html, '', 1, 1, false, 'C', true);
$filePath = SITEDOCUMENT . 'administrator/components/com_jcode/source/report/pdfslice/PatientTrendReport.pdf';
if (file_exists($filePath)) {
unlink($filePath);
}
$pdf->Output('pdfslice/PatientTrendReport.pdf', 'F');
echo 'PatientTrendReport.pdf';
} else {
echo 'Processing Error';
}
}
示例10: DBExecSql
$sql =
"SELECT art.utiles.armar_cuit(sa_cuit) cuit, sa_nombre
FROM asa_solicitudafiliacion
WHERE sa_idformulario = :idformulario";
$stmt = DBExecSql($conn, $sql, $params);
$row2 = DBGetQuery($stmt, 1, false);
if ($autoPrint)
$pdf = new PDF_AutoPrint();
else
$pdf = new FPDI();
$pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_afiliacion/templates/nomina_personal_expuesto.pdf");
$pdf->AddPage("L");
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx, null, null, 0, 0, true);
$pdf->SetFont("Arial", "B", 9);
$pdf->Ln(17);
$pdf->Cell(14);
$pdf->Cell(226, 0, $row2["SA_NOMBRE"]);
$pdf->Cell(16);
$pdf->Cell(0, 0, $row2["CUIT"]);
if ($autoPrint)
$pdf->AutoPrint(false);
$pdf->Output();
?>
示例11: FPDI
break;
case 'letter':
default:
$page_width = 11;
//in
$page_height = 8.5;
//in
}
// initialize pdf
$pdf = new FPDI('L', 'in');
$pdf->SetAutoPageBreak(false);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetMargins(0.5, 0.5, 0.5, true);
//set default font
$pdf->SetFont('helvetica', '', 7);
//add new page
$pdf->AddPage('L', array($page_width, $page_height));
$chunk = 0;
//write the table column headers
$data_start = '<table cellpadding="0" cellspacing="0" border="0" width="100%">';
$data_end = '</table>';
$data_head = '<tr>';
$data_head .= '<td width="7.5%"><b>' . $text['label-direction'] . '</b></td>';
$data_head .= '<td width="15%"><b>' . $text['label-cid-name'] . '</b></td>';
$data_head .= '<td width="8.5%"><b>' . $text['label-cid-number'] . '</b></td>';
$data_head .= '<td width="11%"><b>' . $text['label-destination'] . '</b></td>';
$data_head .= '<td width="11%"><b>' . $text['label-start'] . '</b></td>';
$data_head .= '<td width="4%" align="right"><b>' . $text['label-tta'] . '</b></td>';
$data_head .= '<td width="8.5%" align="right"><b>' . $text['label-duration'] . '</b></td>';
$data_head .= '<td width="8.5%" align="right"><b>' . $text['label-billsec'] . '</b></td>';
示例12: unset
unset($logo);
}
}
$display_logo = true;
}
}
if ($display_logo) {
$pdf->Image($logo, 0.5, 0.4, 2.5, 0.9, null, null, 'N', true, 300, null, false, false, 0, true);
} else {
//set position for header text, if enabled
$pdf->SetXY($x + 0.5, $y + 0.4);
}
//header
if ($fax_header != '') {
$pdf->SetLeftMargin(0.5);
$pdf->SetFont("times", "", 10);
$pdf->Write(0.3, $fax_header);
}
//fax, cover sheet
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont("times", "B", 55);
$pdf->SetXY($x + 4.55, $y + 0.25);
$pdf->Cell($x + 3.5, $y + 0.4, $text['label-fax-fax'], 0, 0, 'R', false, null, 0, false, 'T', 'T');
$pdf->SetFont("times", "", 12);
$pdf->SetFontSpacing(0.0425);
$pdf->SetXY($x + 4.55, $y + 1.0);
$pdf->Cell($x + 3.5, $y + 0.4, $text['label-fax-cover-sheet'], 0, 0, 'R', false, null, 0, false, 'T', 'T');
$pdf->SetFontSpacing(0);
//field labels
$pdf->SetFont("times", "B", 12);
if ($fax_recipient != '' || sizeof($fax_numbers) > 0) {
示例13: array
// Armo el sql principal..
$curs = null;
$params = array(":idtransaccion" => $_REQUEST["id"]);
$sql = "BEGIN art.webart.get_denuncia_siniestro(:data, :idtransaccion); END;";
$stmt = DBExecSP($conn, $curs, $sql, $params);
$row = DBGetSP($curs, false);
// ******* INICIO - Armado del reporte.. *******
$pdf = new FPDI();
$pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/usuarios_registrados/clientes/denuncias_de_siniestros/templates/denuncia_siniestro.pdf");
$pdf->AddPage();
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx);
$pdf->SetFont("Arial", "", 8);
$pdf->Ln(15);
switch ($row["EW_TIPOSINIESTRO"]) {
case 1:
$pdf->Cell(81);
$pdf->Cell(0, 0, "X");
break;
case 2:
$pdf->Cell(113);
$pdf->Cell(0, 0, "X");
break;
case 3:
$pdf->Cell(45.2);
$pdf->Cell(0, 0, "X");
break;
示例14: FPDI
{
protected $_tplIdx;
}
$pdf = new FPDI();
if ($user->getPrivilege() <= 10) {
$source = "docs/certificatelead.pdf";
} else {
$source = "docs/certificate.pdf";
}
$pagecount = $pdf->setSourceFile($source);
$tplidx = $pdf->importPage(1);
$pdf->addPage('L');
$pdf->useTemplate($tplidx, 0, 0, 0);
$date = date('jS F Y');
$pdf->AddFont('DejaVu', '', 'DejaVuSansCondensed.ttf', true);
$pdf->SetFont('DejaVu', '', 30);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY(0, 95);
$pdf->Cell(297, 15, $name, 0, 0, 'C', 0);
$pdf->SetFont('Arial', '', 18);
$pdf->SetXY(170, 160);
$pdf->Write(0, $date);
$attachment = $pdf->output('Certificate.pdf', 'S');
header('Pragma: public');
header('Expires: -1');
header('Content-Transfer-Encoding: binary');
header('Content-Type: application/pdf');
header('Content-Disposition: attachment;filename="ISOS%20Certificate.pdf"');
header('Cache-Control: max-age=0');
// output the file
echo $attachment;
示例15: FPDI
// Now, build a merged files with all files in $files array
//---------------------------------------------------------
// Create empty PDF
$pdf=new FPDI('P','mm','A4');
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
//$pdf->SetCompression(false);
if (class_exists('TCPDF'))
{
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
}
$pdf->SetFont(pdf_getPDFFont($outputlangs));
//$pdf->Open();
//$pdf->AddPage();
//$title=$langs->trans("BillsCustomersUnpaid");
//if ($option=='late') $title=$langs->trans("BillsCustomersUnpaid");
//$pdf->MultiCell(100, 3, $title, 0, 'J');
// Add all others
foreach($files as $file)
{
print "Merge PDF file for invoice ".$file."\n";
// Charge un document PDF depuis un fichier.
$pagecount = $pdf->setSourceFile($file);
for ($i = 1; $i <= $pagecount; $i++)