当前位置: 首页>>代码示例>>PHP>>正文


PHP FPDF::Close方法代码示例

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


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

示例1: preprocess

 function preprocess()
 {
     if (FormLib::get_form_value('start', False) !== False) {
         $pdf = new FPDF('P', 'in', 'Letter');
         $pdf->SetMargins(0.5, 0.5, 0.5);
         $pdf->SetAutoPageBreak(False, 0.5);
         $pdf->AddPage();
         $start = FormLib::get_form_value('start');
         $x = 0.5;
         $y = 0.5;
         $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
         $pdf->SetFont('Gill', '', 16);
         for ($i = 0; $i < 40; $i++) {
             $current = $start + $i;
             $pdf->SetXY($x, $y);
             $pdf->Cell(1.75, 0.5, $current, 0, 0, 'C');
             $pdf->Cell(1.75, 0.5, $current, 0, 0, 'C');
             if ($i % 2 == 0) {
                 $x += 1.75 * 2 + 0.5;
             } else {
                 $x = 0.5;
                 $y += 0.5;
             }
         }
         $pdf->Close();
         $pdf->Output("mem stickers {$start}.pdf", "I");
         return False;
     }
     return True;
 }
开发者ID:phpsmith,项目名称:IS4C,代码行数:30,代码来源:MemberStickerPage.php

示例2: pdf_export_dots


//.........这里部分代码省略.........
    }
    $count_clusters = count($clusters);
    for ($i = 0; $i < $count_clusters; $i++) {
        $dots = $clusters[$i];
        $_legend = array();
        $j = 0;
        foreach ($dots as $dot) {
            $_legend[$dot['id']] = $legend[$dot['id']];
            $j++;
            if ($j >= $count_legend_items) {
                break;
            }
        }
        usort($_legend, "sort_by_lat");
        $pdf->AddPage();
        $pdf->Image($maps[$i], 0, 0, 0, 0, 'PNG');
        $pdf->SetFont('Helvetica', '', 10);
        $x = $h + $margin;
        $y = $margin;
        foreach ($_legend as $dot) {
            $text = "{$dot['id']} / pg. {$dot['page']}";
            $pdf->SetXY($x, $y);
            $pdf->Cell(0, $row_h, $text);
            $loc = new MMaps_Location($dot['latitude'], $dot['longitude']);
            $pt = $map->locationPoint($loc);
            $x1 = $x - $margin / 8;
            $y1 = $y + $row_h / 2;
            $x2 = $pt->x / $dpi;
            $y2 = $pt->y / $dpi;
            $pdf->Line($x1, $y1, $x2, $y2);
            $y += $row_h * 1.1;
        }
    }
    # Now the rows (of dots)
    foreach ($pages as $page) {
        $pdf->AddPage();
        $x = $margin;
        $y = $margin;
        $z = 0;
        foreach ($page as $data) {
            $style = $data['bold'] ? 'B' : '';
            $pdf->SetFont('Helvetica', $style, 10);
            $x_offset = $col_width * 0.1;
            $y_offset = $data['height'] * 0.1;
            $max_width = $col_width - $x_offset * 3;
            $bg = $z % 2 ? 255 : 235;
            $z++;
            foreach ($data['row'] as $value) {
                $value = trim($value);
                $width = $pdf->GetStringWidth($value);
                $pdf->SetFillColor($bg);
                $pdf->Rect($x, $y, $col_width, $data['height'], 'F');
                # Don't bother with MultiCell - it is behaving
                # badly (20110120/straup)
                if ($width < $max_width) {
                    $pdf->SetXY($x + $x_offset, $y + $y_offset);
                    $pdf->Cell(0, $row_h, $value);
                } else {
                    $_x = $x;
                    $_y = $y;
                    $lines = array();
                    $buffer = '';
                    foreach (str_split($value) as $char) {
                        if ($buffer == '' && $char == ' ') {
                            continue;
                        }
                        $buffer .= $char;
                        $width = $pdf->GetStringWidth($buffer);
                        if ($width >= $max_width) {
                            $lines[] = $buffer;
                            $buffer = '';
                        }
                    }
                    if (strlen($buffer)) {
                        $lines[] = $buffer;
                        $buffer = '';
                    }
                    foreach ($lines as $ln) {
                        $pdf->SetXY($_x + $x_offset, $_y + $y_offset);
                        $pdf->Cell(0, $row_h, $ln);
                        $_y += $row_h * 0.8;
                    }
                }
                $x += $col_width;
            }
            $x = $margin;
            $y += $data['height'];
        }
    }
    # Go!
    $pdf->Close();
    $pdf->Output($more['path'], 'F');
    $pdf = null;
    foreach ($maps as $map_img) {
        if (!unlink($map_img)) {
            error_log("[EXPORT] (pdf) unlink {$map_img} : {$ok}");
        }
    }
    return $more['path'];
}
开发者ID:netcon-source,项目名称:dotspotting,代码行数:101,代码来源:lib_pdf.php

示例3: EWD_UFAQ_Export_To_PDF

function EWD_UFAQ_Export_To_PDF()
{
    require_once EWD_UFAQ_CD_PLUGIN_PATH . '/FPDF/fpdf.php';
    if ($Category != "EWD_UFAQ_ALL_CATEGORIES") {
        $category_array = array('taxonomy' => 'ufaq-category', 'field' => 'slug', 'terms' => $Category->slug);
    }
    $params = array('posts_per_page' => -1, 'post_type' => 'ufaq');
    $faqs = get_posts($params);
    $PDFPasses = array("FirstPageRun", "SecondPageRun", "Final");
    foreach ($PDFPasses as $PDFRun) {
        $pdf = new FPDF();
        $pdf->AddPage();
        if ($PDFRun == "SecondPageRun" or $PDFRun == "Final") {
            $pdf->SetFont('Arial', 'B', 14);
            $pdf->Cell(20, 10, "Page #");
            $pdf->Cell(20, 10, "Article Title");
            $pdf->Ln();
            $pdf->SetFont('Arial', '', 12);
            foreach ($ToC as $entry) {
                $pdf->Cell(20, 5, "  " . $entry['page']);
                $pdf->MultiCell(0, 5, $entry['title']);
                $pdf->Ln();
            }
            unset($ToC);
        }
        foreach ($faqs as $faq) {
            $PostTitle = strip_tags(html_entity_decode($faq->post_title));
            $PostText = strip_tags(html_entity_decode($faq->post_content));
            $PostText = str_replace("&#91;", "[", $PostText);
            $PostText = str_replace("&#93;", "]", $PostText);
            $pdf->AddPage();
            $Entry['page'] = $pdf->page;
            $Entry['title'] = $PostTitle;
            $pdf->SetFont('Arial', 'B', 15);
            $pdf->MultiCell(0, 10, $PostTitle);
            $pdf->Ln();
            $pdf->SetFont('Arial', '', 12);
            $pdf->MultiCell(0, 10, $PostText);
            $ToC[] = $Entry;
            unset($Entry);
        }
        if ($PDFRun == "FirstPageRun" or $PDFRun == "SecondPageRun") {
            $pdf->Close();
        }
        if ($PDFRun == "Final") {
            $pdf->Output('Ultimate-FAQ-Manual.pdf', 'D');
        }
    }
}
开发者ID:hkarriche,项目名称:wordpress,代码行数:49,代码来源:EWD_UFAQ_Export_To_PDF.php

示例4: Close

 function Close()
 {
     parent::Close();
     // clean up tmp files
     foreach ($this->tmpFiles as $tmp) {
         @unlink($tmp);
     }
 }
开发者ID:hansstam,项目名称:makerfaire,代码行数:8,代码来源:fpdf_alpha.php

示例5: dirname

<?php

require dirname(__FILE__) . '/../../pacotes/fpdf/fpdf.php';
include "geraimagens.php";
$pdf = new FPDF("L", "mm", "A4");
$pdf->Open();
$pdf->AddPage();
$pdf->Image($nomemapa, 0, 0, $w - 50, $h - 50, 'PNG');
$pdf->Close();
//$nomepdf = $dir_tmp.'/'.$imgdir.'/'.$nomes.'.pdf';
$pdf->Output("mapa.pdf", true);
开发者ID:edmarmoretti,项目名称:i3geo,代码行数:11,代码来源:a4lpdf.php

示例6: Close

 /**
  * Wrapper for FPDF::Close. It's main purpose is to
  * replace {nb} by our own count and not the number FPDF counted.
  *
  * @author Former03 GmbH :: Florian Lippert <flo@syscp.org>
  */
 function Close()
 {
     // taken from original fpdf-class
     $nb = $this->page;
     if (!empty($this->AliasNbPages)) {
         //Replace number of pages
         for ($n = 1; $n <= $nb; $n++) {
             $this->pages[$n] = str_replace($this->AliasNbPages, $this->_my_page_count, $this->pages[$n]);
         }
     }
     parent::Close();
 }
开发者ID:HobbyNToys,项目名称:SysCP,代码行数:18,代码来源:class.PDF.php

示例7: preparePdf

 public function preparePdf()
 {
     $genPdf = new FPDF();
     $recipients = Campaign::getRecipients($this->group);
     $genPdf->AddPage();
     $genPdf->SetFont('Arial', 'B', "9px");
     foreach ($recipients as &$recipient) {
         if (!is_null($recipient->getHash($this->id))) {
             $genPdf->Cell("100%", "12px", $this->name . " Voter: " . $recipient->getName(), "LBT", 0);
             $genPdf->Cell("95%", "12px", "Hash: " . $recipient->getHash($this->getId()), "RBT", 1, 'R');
         }
     }
     $genPdf->Output();
     $genPdf->Close();
 }
开发者ID:swat30,项目名称:safeballot,代码行数:15,代码来源:Campaign.php

示例8: createEmptyRenderError

    public static function createEmptyRenderError($filename,$filepath){


        require_once(Yii::app()->basePath.'/extensions/Fpdf/fpdf.php');

        $pdf = new FPDF('P','mm','Letter');

        $pdf->SetAuthor('ASA AP');
        $pdf->SetTitle('Render error');
        //set font for the entire document
        $pdf->SetFont('Helvetica','B',20);
        $pdf->SetTextColor(255,0,0);
        //set up a page
        $pdf->AddPage('P');
        $pdf->SetDisplayMode(90,'default');

        //Set x and y position for the main text, reduce font size and write content
        $pdf->SetXY (30,55);
        $pdf->SetFontSize(15);
        $pdf->Write(5,'Existing document '.$filename.' can\'t be rendered');
        //Output the document
        $pdf->Output($filepath,'F');
        $pdf->Close();

        return $filepath;
    }
开发者ID:ranvijayj,项目名称:htmlasa,代码行数:26,代码来源:FileModification.php

示例9: printFPDF


//.........这里部分代码省略.........
		$DIRPATH= substr($DIRPATH,0,$pos1)."/pdf/";
	}
	$pdf_FILE_NAME = session_id(). "MapLocator.pdf";
	$pdf_FILE_PATH = $DIRPATH. $pdf_FILE_NAME ;

	$pdf = new FPDF('P', 'pt', array(640,450));
	$pdf->AddPage();
	$pdf->SetFont('Arial','B',10);

	$domain = getenv("HTTP_HOST");

	//base map
	$base_url = $pdfobj->BaseUrl;
	$base_url = str_replace(' and ','&' ,$base_url);

	if (strpos($base_url,'http://') === false) {
		//since client sends only relative path a full http url needs to constructed here
		$base_url = 'http://'. $domain. $base_url;
		//echo 'here';
	}


	$base_image = createImageForPDF($base_url,$DIRPATH.'base');
	$base_image_jpeg = $DIRPATH.'base'.session_id() .'.jpeg';
	png2jpg($base_image, $base_image_jpeg, 100);

	$layerURL = $pdfobj->LayerURL;

	$layerURL = str_replace(' and ','&' ,$layerURL );

	//since client sends only relative path a full http url needs to constructed here
	$layerURL = 'http://'. $domain. $layerURL;
	$layer = $pdfobj->Layer;
	$legendURL = $pdfobj->LegendURL;
	$legendURL = 'http://'. $domain. $legendURL;
	$legendURL = str_replace(' and ','&' ,$legendURL );

	$image = createImageForPDF($layerURL,$DIRPATH.$layer);

	$image_jpeg = $DIRPATH.$layer.session_id() .'.jpeg';
	png2jpg($image, $image_jpeg, 100);

	$url = 'http://'. $domain. base_path().'ImageMerge.php?baseimage='.$base_image_jpeg.'&overlayimage='.			$image_jpeg;

	$merged_image_buff = file_get_contents($url);

	$final_image =$DIRPATH.'merge.jpeg';

	$fh = fopen($final_image,"w");
  	fwrite($fh,$merged_image_buff);
	fclose($fh);


	$pdf->Image($final_image,0,30);

	$image = createImageForPDF($legendURL,$DIRPATH.$layer.'_legend');
	$image_jpeg = $DIRPATH.$layer.'_legend'.session_id() .'.jpeg';
	png2jpg($image, $image_jpeg, 100);
	$size = getimagesize($image);
	$width = $size[0];
	$height = $size[1];



	$pdf->sety(25);
	$pdf->Cell(0,0,"Layer Name: ". $pdfobj->LayerName);


	$top_scale = $pdfobj->TopScale;
	$bottom_scale = $pdfobj->BottomScale;


	$pdf->Text(0,430,"Scalebar: ");
	$pdf->Text(50,430,"| ".$top_scale." |");
	$pdf->Text(50,430,"  _____ ");
	$pdf->Text(50,440,"| ".$bottom_scale." |");
	$pdf->Text(475,445,"Created by Map Locator");


	if($width < 100){//show legend on the map/same page
		$pdf->Image($image_jpeg,640 - $width,30);
		$pdf->sety(20);
		$pdf->setX(-75);
		$pdf->Cell(20,10,"Legend ");
	}else{//show legend on the next page
		$pdf->AddPage();
		$pdf->Image($image_jpeg,0,30);
		$pdf->sety(20);
		$pdf->setX(5);
		$pdf->Cell(20,10,"Legend ");
	}



	$pdf->Output($pdf_FILE_PATH,'F');
	$pdf->Close();
	return $pdf_FILE_NAME;


}
开发者ID:rahool,项目名称:maplocator,代码行数:101,代码来源:printPDF.php

示例10: isset

 function sign_pdf()
 {
     global $FANNIE_ROOT;
     $desc = isset($_REQUEST['desc']) ? $_REQUEST['desc'] : '&nbsp;';
     $price = isset($_REQUEST['price']) ? $_REQUEST['price'] : '&nbsp;';
     if (isset($_REQUEST['scale']) && $_REQUEST['scale'] == 1) {
         $price .= " / lb";
     }
     $price = '$' . $price;
     $origin = isset($_REQUEST['origin']) ? $_REQUEST['origin'] : '&nbsp;';
     require $FANNIE_ROOT . 'src/fpdf/fpdf.php';
     define('FPDF_FONTPATH', $FANNIE_ROOT . 'src/fpdf/font/');
     $pdf = new FPDF('L', 'in', 'Letter');
     $pdf->SetMargins(0.59, 0.25, 0.59);
     $pdf->SetAutoPageBreak(False, 0.25);
     $pdf->AddPage();
     $pdf->AddFont('ScalaSans-Bold', 'B', 'ScalaSans-Bold.php');
     $pdf->AddFont('ScalaSans', '', 'ScalaSans.php');
     $pdf->SetFont('ScalaSans', '', 22);
     $pdf->SetXY(0.25, 5.87);
     $pdf->Cell(5.26, 0.54, $desc, 1, 0, 'C');
     $pdf->SetFont('ScalaSans-Bold', 'B', 70);
     $pdf->SetXY(0.25, 6.41);
     $pdf->Cell(5.26, 1.3, $price, 1, 0, 'C');
     $pdf->SetXY(0.25, 7.71);
     $pdf->SetFont('ScalaSans', '', 18);
     $pdf->Cell(5.26, 0.54, $origin, 1, 0, 'L');
     $pdf->Close();
     $pdf->Output("sign.pdf", "I");
 }
开发者ID:phpsmith,项目名称:IS4C,代码行数:30,代码来源:ProduceSign.php

示例11: geraProcessosDetran


//.........这里部分代码省略.........
     $frase .= $imprimir_topo;
     $bloco = '';
     if ($res_oficio->id_pedido != '') {
         $linha_bloco = 1;
         $orgao_regiao = $res_oficio->certidao_cidade;
         $orgao_regiao .= '-' . $res_oficio->certidao_estado;
         $impressao_ordem = '#' . $res_oficio->id_pedido . '/' . $res_oficio->ordem . ' ';
         $responsavel_endereco = $res_oficio->endereco . ' ' . $res_oficio->numero . ' ' . $res_oficio->complemento;
         $data_atual = $res_oficio->cidade . ', ' . date(d) . ' de ' . $mes . ' de 20' . date(y) . '.';
         $topo = str_replace('<certidao_nome>', $res_oficio->certidao_nome, $imprimir_topo);
         $topo = str_replace('<certidao_cnpj>', $res_oficio->certidao_cnpj, $topo);
         $topo = str_replace('<certidao_cpf>', $res_oficio->certidao_cpf, $topo);
         $topo = str_replace('<orgao>', $orgao, $topo);
         $topo = str_replace("<resultado>", $resultado, $topo);
         $topo = str_replace("<orgao_regiao>", $orgao_regiao, $topo);
         $topo = str_replace('<responsavel_empresa>', $res_oficio->fantasia, $topo);
         $topo = str_replace('<responsavel_endereco>', $responsavel_endereco, $topo);
         $topo = str_replace('<responsavel_cidade>', $res_oficio->cidade, $topo);
         $topo = str_replace('<responsavel_estado>', $res_oficio->estado, $topo);
         $topo = str_replace("<data>", $data_atual, $topo);
         $topo = str_replace('<impressao_ordem>', $impressao_ordem, $topo);
         $sub = str_replace('<responsavel_empresa>', $res_oficio->fantasia, $imprimir_sub);
         $sub = str_replace('<responsavel_endereco>', $responsavel_endereco, $sub);
         $sub = str_replace('<responsavel_cidade>', $res_oficio->cidade, $sub);
         $sub = str_replace('<responsavel_estado>', $res_oficio->estado, $sub);
         $sub = str_replace('<responsavel_cep>', $res_oficio->cep, $sub);
         $sub = str_replace('<responsavel_tel>', $res_oficio->tel, $sub);
         $sub = str_replace('<responsavel_fax>', $res_oficio->fax, $sub);
         $sub = str_replace('<responsavel_email>', $res_oficio->email, $sub);
         $pdf->AddPage();
         $pdf->Image('../images/header.jpg', '0', '0', '19', '3,04', 'JPG');
         $pdf->SetFont('', 'B', 12);
         $pdf->Cell('', 2, 'NÃO EMITIMOS E NEM VENDEMOS CERTIDÕES E SIM PRAZOS E SOLUÇÕES', '', 1, 'C');
         $pdf->SetFont('', 'B', 14);
         $pdf->Cell('', 2, 'Declaração de Busca', '', 1, 'C');
         $pdf->SetFont('', '', 12);
         $pdf->Write(1, $topo, '');
         $pdf->SetFont('', '', 12);
         $pdf->Cell('', 1, '', '', 1, 'C');
         $pdf->Cell('', 1, '', '', 1, 'C');
         $pdf->Cell('', 1, '', '', 1, 'C');
         $pdf->Cell('', 1, '', '', 1, 'C');
         $pdf->Cell('', 1, '', '', 1, 'C');
         $pdf->Cell('', 1, '', '', 1, 'C');
         $pdf->Cell('', 1, $data_atual, '', 1, 'C');
         $pdf->Cell('', 1, $impressao_ordem, '', 1, 'R');
         $pdf->ln();
         $pdf->ln();
         $pdf->ln();
         $pdf->ln();
         $pdf->Cell('', 1, $res_oficio->fantasia, '', 1, 'C');
         $pdf->ln();
         $pdf->ln();
         $pdf->Write(0.5, $sub, '');
         $pdf->Line(1, 25, 20, 25);
         $pdf->Ln();
         $pdf->Cell('', 0.5, $rodape, '', 1, 'C');
         $rodape = $responsavel_endereco . ', ' . $res_oficio->cidade . '-' . $res_oficio->estado . ' CEP: ' . $res_oficio->cep;
         $pdf->Cell('', 0.5, $rodape, '', 1, 'C');
         $rodape = 'Tel/Fax: ' . $res_oficio->tel . '/' . $res_oficio->fax . ' E-mail:' . $res_oficio->email;
         $pdf->Cell('', 0.5, $rodape, '', 1, 'C');
         $rodape = 'www.cartoriopostal.com.br';
         $pdf->Cell('', 0.5, $rodape, '', 1, 'C');
         if ($anexar == 'on' and $res_oficio->id_servico == '16') {
             $pdf->Close();
             //imprime a saida
             $num_a = $anexoDAO->listaAnexoPedidoNome($res_oficio->id_pedido_item, 'Declaração de Busca');
             if (COUNT($num_a) == 0) {
                 $file_path = "../anexosnovos/" . date('m') . '' . date('Y') . '/';
                 #alterado => "../anexos/"
                 if (!is_dir($file_path)) {
                     mkdir($file_path, 0777);
                 }
                 #alterado
                 $arq_anexo = $file_path . 'decla_busca_' . $res_oficio->id_pedido_item . '_' . time() . '.pdf';
                 $pdf->Output($arq_anexo, 'F');
                 //imprime a saida
                 $anexo->anexo = $arq_anexo;
                 $anexo->anexo_nome = 'Declaração de Busca';
                 $anexo->id_pedido_item = $res_oficio->id_pedido_item;
                 $anexo->id_usuario = $id_usuario;
                 $anexoDAO->inserir($anexo);
                 $ativ = $atividadeDAO->inserir('209', '', $id_usuario, $res_oficio->id_pedido_item);
                 return 'Declaração anexada para ' . $impressao_ordem . '<br>';
             } else {
                 return 'Declaração não pode ser anexada para ' . $impressao_ordem . ' porque o anexo já existe<br>';
             }
         } else {
             if ($anexar == 'on' and $res_oficio->id_servico != '16') {
                 return '<b>Declaração não pode ser anexada para ' . $impressao_ordem . ' porque o serviço não é "Pesquisa Detran</b>"<br>';
             }
         }
     }
     if ($anexar != 'on') {
         return $pdf->Output();
         //imprime a saida
     } else {
         return 1;
     }
 }
开发者ID:tricardo,项目名称:CartorioPostal_old,代码行数:101,代码来源:GeraAnexoCLASS.php


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