本文整理汇总了PHP中MYPDF::SetAutoPageBreak方法的典型用法代码示例。如果您正苦于以下问题:PHP MYPDF::SetAutoPageBreak方法的具体用法?PHP MYPDF::SetAutoPageBreak怎么用?PHP MYPDF::SetAutoPageBreak使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MYPDF
的用法示例。
在下文中一共展示了MYPDF::SetAutoPageBreak方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadPage
function loadPage()
{
// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->titulo = $this->getPlan();
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Red de Universidades Anahuac');
$pdf->SetTitle('Plan Estrategico');
$pdf->SetSubject($this->getPlan());
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
//$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', 'N', 11);
// add a page
$pdf->AddPage();
$pdf->SetY(5);
$html = "\n<!-- EXAMPLE OF CSS STYLE -->\n<style> \n\ttd{\n\tborder:1px solid #666;\n\t}\n\t\n\ttd.title{\n\tbackground:#E5E5E5;\n\tpadding:10px;\n\t}\n \n</style> <br />";
$html .= $this->Model->getLineas();
// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');
//Close and output PDF document
$pdf->Output('plan_operativo.pdf', 'I');
}
示例2: generarMYPDF
public function generarMYPDF($atributosReceta, $labelCabecera, $labelDetalle, $labelPie, $datosCabecera, $datosDetalle, $datosPie, $modo, $nombreReceta, $parametros)
{
/* ======================================= Obs ============================================ */
// width->0, height->1, top->2, left->3, color->4 TipoLetra=>5 EstiloLetra=>6 TamañoLetra=>6
/* ===================================================================================================== */
$lblCabecera = array();
$lblDetalle = array();
$lblPie = array();
$styleCL = array();
$styleCD = array();
$styleDL = array();
$styleDD = array();
$stylePL = array();
$stylePD = array();
$o_classGeneral = new classGeneral();
$o_classGeneral->setLabelCabecera($labelCabecera, $atributosReceta);
$styleCL = $o_classGeneral->getStyleCL();
$styleCD = $o_classGeneral->getStyleCD();
$lblCabecera = $o_classGeneral->getLblCabecera();
$o_classGeneral->setLabelDetalle($labelDetalle, $atributosReceta);
$styleDL = $o_classGeneral->getStyleDL();
$styleDD = $o_classGeneral->getStyleDD();
$lblDetalle = $o_classGeneral->getLblDetalle();
$o_classGeneral->setLabelPie($labelPie, $atributosReceta);
$stylePL = $o_classGeneral->getStylePL();
$stylePD = $o_classGeneral->getStylePD();
$lblPie = $o_classGeneral->getLblPie();
/* ====================================================================================================== */
// create new PDF document //PDF_PAGE_ORIENTATION(P,L)
$pdf = new MYPDF($parametros["PDF_PAGE_ORIENTATION"], PDF_UNIT, $parametros["PDF_PAGE_FORMAT"], true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Juan Carlos Ludeña Montesinos');
$pdf->SetTitle('Generardor de Reportes');
$pdf->SetSubject('Generardor de Reportes');
//$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set default header data
//$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 011', PDF_HEADER_STRING);
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// remove default header/footer
$pdf->setPrintHeader($parametros["PRINT_HEADER"]);
$pdf->setPrintFooter($parametros["PRINT_FOOTER"]);
//set margins
$pdf->SetMargins($parametros["PDF_MARGIN_LEFT"], $parametros["PDF_MARGIN_TOP"], $parametros["PDF_MARGIN_RIGHT"]);
$pdf->SetHeaderMargin($parametros["PDF_MARGIN_HEADER"]);
$pdf->SetFooterMargin($parametros["PDF_MARGIN_FOOTER"]);
//set auto page breaks
$pdf->SetAutoPageBreak($parametros["AUTO_PAGE_BREAK"], $parametros["PDF_MARGIN_BOTTOM"]);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
//$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 6);
// add a page
$pdf->AddPage();
//Data loading
// print colored table
$pdf->ColoredTable($lblCabecera, $lblDetalle, $lblPie, $datosCabecera, $datosDetalle, $datosPie, $styleCL, $styleDL, $stylePL, $styleCD, $styleDD, $stylePD, $modo);
$pdf->lastPage();
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output($nombreReceta, 'I');
//$pdf->extractCSSproperties();
//============================================================+
// END OF FILE
//============================================================+
}
示例3: pdfGen
function pdfGen($group_name, $mode = NULL, $start_date, $end_date, $stats, $l, $title, $path_www)
{
global $centreon_path;
// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator("PDF Reports Module");
$pdf->SetAuthor(getGeneralOptInfo("pdfreports_report_author"));
//$pdf->SetAuthor('Fully Automated Nagios');
$pdfTitle = $title . " " . $group_name;
//$pdfTitle = "Rapport de supervision du hostgroup ".$group_name;
$pdf->SetTitle($pdfTitle);
//$pdf->SetSubject('TCPDF Tutorial');
//$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// define default header data
$header = $title . " " . $group_name;
//$header = "Rapport de supervision du hostgroup ".$group_name;
//$ip = $_SERVER['HOSTNAME'];
$startDate = date("d/m/Y", $start_date);
$time = time();
$endDate = date("d/m/Y", $time);
$string = _("From") . " " . strftime("%A", $start_date) . " " . $startDate . " " . _("to") . " " . strftime("%A", $time) . " " . $endDate . "\n";
// set default header data
$pdf->SetHeaderData('../../../img/headers/' . getGeneralOptInfo("pdfreports_report_header_logo"), PDF_HEADER_LOGO_WIDTH, $header, $string);
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 12);
// add a page
$pdf->AddPage();
//Column titles
$header = array('Status', 'Time', 'Total Time', 'Mean Time', 'Alert');
// Pie chart Generation
$piechart_img = pieGen($stats, $mode);
//Data loading
$data = $pdf->LoadData($stats);
// print colored table
//$pdf->ColoredTable($header, $data,$chart_img);
if ($mode == "hgs") {
// Hostgroup
$pdf->ColoredTable($header, $data, $piechart_img, $path_www);
} else {
if ($mode == "sgs") {
// Servicegroup
$pdf->ServicesColoredTable($header, $data, $piechart_img, $path_www);
}
}
// ---------------------------------------------------------
//génération d'un nom de pdf
$endDay = date("d", $time);
$endYear = date("Y", $time);
$endMonth = date("m", $time);
$pdfDirName = getGeneralOptInfo("pdfreports_path_gen") . $endYear . $endMonth . $endDay . "/";
$pdfFileName = $pdfDirName . $endYear . "-" . $endMonth . "-" . $endDay . "_" . $group_name . ".pdf";
if (!is_dir($pdfDirName)) {
mkdir($pdfDirName);
}
//Close and output PDF document
$pdf->Output($pdfFileName, 'F');
return $pdfFileName;
}
示例4: implode
// set footer fonts
//$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set pdf information
$pdf->SetTitle($pdf_strings['FACTURE'] . ": " . $account_name);
$pdf->SetAuthor($owner_firstname . " " . $owner_lastname . ", " . $org_name);
$pdf->SetSubject($account_name);
$pdf->SetCreator('PDF Creator from www.crm-now.com');
//list product names as keywords
$productlisting = implode(", ", $product_name);
$pdf->SetKeywords($productlisting);
//Disable automatic page break
$pdf->SetAutoPageBreak(true, PDF_MARGIN_FOOTER);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
//initialize document
$pdf->AliasNbPages();
//in reference to body.php -> if a new page must be added if the space available for summary is too small
$new_page_started = false;
$pdf->AddPage();
$pdf->setImageScale(1.5);
//$pdf->SetY(PDF_MARGIN_HEADER);
include "modules/SalesOrder/pdf_templates/header.php";
$pdf->SetFont($default_font, " ", $font_size_body);
include "modules/SalesOrder/pdf_templates/body.php";
// issue pdf
示例5: MYPDF
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_INVOICE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Pharm Sys');
$pdf->SetTitle('Receipt');
$pdf->SetSubject('Payment');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
//$pdf->SetHeaderData(PDF_RECEIPT_LOGO, PDF_RECEIPT_LOGO_WIDTH, PDF_RECEIPT_TITLE, PDF_HEADER_STRING, array(0,0,0), array(0,0,0));
//$pdf->setHeaderFont(Array(PDF_FONT_NAME_RECEIPT, '', PDF_FONT_SIZE_RECEIPT));
//$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(PDF_INVOICE_LEFT, PDF_INVOICE_TOP, PDF_INVOICE_RIGHT);
$pdf->SetHeaderMargin(PDF_INVOICE_HEADER);
$pdf->SetFooterMargin(PDF_INVOICE_FOOTER);
$pdf->SetAutoPageBreak(TRUE, PDF_INVOICE_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setLanguageArray($l);
$pdf->SetFont('times', '', 10, '', true);
$pdf->AddPage();
$spacing = -0.01;
$stretching = 75;
$pdf->setFontStretching($stretching);
$pdf->setFontSpacing($spacing);
$titling = <<<EOD
<strong> <font style="font-size:11">Pharmacy Sys</font> </strong> <br> <strong>Official Receipt</strong><br>
Student Center Ground Floor,<br> P.O. Box Private Bag Kabarak, Kenya <br> Tel: +254 702 937 925 <br> E-mail: pharmacysys@yahoo.com
<br>-----------------------------------------
EOD;
$header = array('Drug', 'Price.', 'Qtty', 'Cost(Kshs.)');
$ddt = <<<EOD
示例6: cetak
public function cetak($idquotationsales = null, $idrefstore = null)
{
if ($idquotationsales == null) {
exit('Data Tidak Tersedia');
}
$data = $this->orm->quotationsales->where('idquotationsales', $idquotationsales)->fetch();
if (count($this->orm->quotationsales->where('idquotationsales', $idquotationsales)) == 0) {
echo "<h3>Data Tidak Tersedia</h3>";
exit;
}
//check from web
if ($idrefstore == null) {
$email = $_SESSION['user']['email'];
$idrefstore = $_SESSION['user']['idrefstore'];
} else {
//from mobile
$email = $this->input->post('email');
}
ini_set('memory_limit', '512M');
$this->load->library('TCPDF');
// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'A4', true, 'UTF-8', false);
// set document information
$pdf->SetCreator(WEB_TITLE);
$pdf->SetAuthor($email);
$pdf->SetTitle("Quotation - " . $data['nomor']);
$pdf->SetSubject($data['nomor']);
$pdf->nomor = $data['nomor'];
$pdf->tanggal = $data['tanggal'];
$pdf->namaPelanggan = $data->pelanggan['namapelanggan'];
$pdf->dibuat_oleh = $data['dibuat_oleh'];
$pdf->oleh = $email;
$pdf->store = $this->orm->refstore->where('idrefstore', $idrefstore)->fetch();
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(5, 63, 5);
$pdf->SetHeaderMargin(14);
$pdf->SetFooterMargin(80);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, 80);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, 80);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// ---------------------------------------------------------
// set default font subsetting mode
$pdf->setFontSubsetting(true);
// Set font
// dejavusans is a UTF-8 Unicode font, if you only need to
// print standard ASCII chars, you can use core fonts like
// helvetica or times to reduce file size.
// use the font
$pdf->SetFont('times', '', 10, '', false);
// Add a page
// This method has several options, check the source code documentation for more information.
$resolution = array(310, 210);
$pdf->AddPage('L', $resolution);
// Set some content to print
$html = '
<style>
body {
letter-spacing:5px;
}
</style>
<style type="text/css">
.rotate-text
{
/* Safari */
-webkit-transform: rotate(-90deg);
/* Firefox */
-moz-transform: rotate(-90deg);
/* IE */
-ms-transform: rotate(-90deg);
/* Opera */
-o-transform: rotate(-90deg);
/* Internet Explorer */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
.border-table{
border:0.5px solid #000;
}
table {
padding-top:2px;
}
</style>
<body>
<table border="1">
<tr><th style="text-align: center;" width="60"> No </th><th width="180" style="text-align: center;"> Nama Barang </th><th style="text-align: center;" width="100"> Jumlah Barang </th><th style="text-align: center;" width="300"> Harga Satuan </th><td style="text-align: center; "width="300"> Keterangan </td></tr>
//.........这里部分代码省略.........
示例7: generatePdfReport
//.........这里部分代码省略.........
}
if (!empty($entry->answer2)) {
if (empty($responses[$entry->response_id]->questions[$entry->question_id]->answer)) {
$responses[$entry->response_id]->questions[$entry->question_id]->answer = $entry->answer2;
} else {
$responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $entry->answer2;
}
}
if (!empty($entry->free_text)) {
// do special types formatting //
if ($responses[$entry->response_id]->questions[$entry->question_id]->question_type == S_SPECIAL_NAME) {
$names = explode('|', $entry->free_text);
if (!empty($names)) {
$entry->free_text = $names[0] . '. ' . $names[1] . ' ' . $names[2];
} else {
$entry->free_text = '';
}
} else {
if ($responses[$entry->response_id]->questions[$entry->question_id]->question_type == S_SPECIAL_ADDRESS) {
$parts = explode('|||', $entry->free_text);
if (count($parts) == 7) {
$entry->free_text = '<address><strong>' . CJFunctions::escape($parts[0]) . '</strong><br>';
$entry->free_text .= CJFunctions::escape($parts[1]) . '<br>';
if (!empty($parts[2])) {
$entry->free_text .= CJFunctions::escape($parts[2]) . '<br>';
}
$entry->free_text .= CJFunctions::escape($parts[3]) . ', ' . CJFunctions::escape($parts[4]) . ', ' . CJFunctions::escape($parts[6]) . '<br>';
$entry->free_text .= !empty($countries[$parts[5]]) ? $countries[$parts[5]]->country_name : CJFunctions::escape($parts[5]);
} else {
$entry->free_text = '';
}
}
}
// do special types formatting //
if (empty($responses[$entry->response_id]->questions[$entry->question_id]->answer)) {
$responses[$entry->response_id]->questions[$entry->question_id]->answer = $entry->free_text;
} else {
$responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $entry->free_text;
}
}
}
}
}
$response_rows = array();
foreach ($responses as $id => $response) {
$string = '<table class="table table-striped" width="100%">';
$string = $string . '<tr><th width="30%"><strong>Response ID:</strong></th><td width="70%">' . $id . '</td></tr>';
$string = $string . '<tr><th><strong>Response Date:</strong></th><td>' . $response->created . '</td></tr>';
$string = $string . '<tr><th><strong>User ID:</strong></th><td>' . $response->created_by . '</td></tr>';
$string = $string . '<tr><th><strong>Username:</strong></th><td>' . $response->username . '</td></tr>';
$string = $string . '<tr><th><strong>User Display Name:</strong></th><td>' . $response->name . '</td></tr>';
if ($include_email_in_reports == 1) {
$string = $string . '<tr><td><strong>Email:</strong></td><td>' . $response->email . '</td></tr>';
}
foreach ($pdfData->questions as $question) {
$string = $string . '<tr><td colspan="2"> <hr></td></tr>';
$string = $string . '<tr><th colspan="2"><h3>' . $question->title . '</h3></th></tr>';
if (!empty($question->description)) {
$string = $string . '<tr><td colspan="2">' . $question->description . '</td></tr>';
}
$string = $string . '<tr><td colspan="2"> </td></tr>';
$string = $string . '<tr><td colspan="2">' . $response->questions[$question->id]->answer . '</td></tr>';
}
$string = $string . '</table>';
array_push($response_rows, $string);
}
// create new PDF document
require_once JPATH_COMPONENT_SITE . '/helpers/tcpdf.php';
$pdf = new MYPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set default header data
$pdf->SetHeaderData('logo.png', PDF_HEADER_LOGO_WIDTH, $pdfData->title, '');
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('corejoomla.com');
$pdf->SetTitle('Survey Report');
$pdf->SetSubject('Survey Responses Report');
$pdf->SetKeywords('survey, report');
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// ---------------------------------------------------------
// set font
$pdf->SetFont('freesans');
foreach ($response_rows as $i => $response) {
$pdf->AddPage();
$pdf->writeHTML($response, true, false, true, false, '');
$pdf->lastPage();
}
$pdf->Output($fileName, $mode);
}
示例8: MYPDF
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('KoaLA');
$pdf->SetTitle($exam_name);
$pdf->SetSubject(gettext("exam results"));
$pdf->SetKeywords(gettext("exam results") . ", " . $exam_name);
// header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(true);
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
//set auto page breaks
$pdf->SetAutoPageBreak(FALSE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
//$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// first page
$pdf->AddPage();
$pdf->Line(20, 20, 190, 20);
$pdf->ImageEps('../extensions/exam_organization/images/upb_logo.ai', 30, 30, 13);
$pdf->SetFont('helvetica', '', 16);
$pdf->MultiCell(80, 3, gettext("exam results"), 0, 'C', 0, 0, 75, 25);
$pdf->SetFont('helvetica', 'B', 16);
$pdf->MultiCell(130, 3, $exam_name, 0, 'C', 0, 0, 50, 33);
$pdf->MultiCell(130, 3, $date . " (" . $semester . ")", 0, 'C', 0, 0, 50, 40);
$pdf->SetFont('helvetica', '', 10);
示例9: boookattach
function boookattach($results, $type = '')
{
// Include the main TCPDF library (search for installation path).
//require_once('tcpdf/examples/tcpdf_include.php');
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'utf-8', false);
//$pdf->Footer('hello');
// create new PDF document
//$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
//$pdf->SetAuthor('Nicola Asuni');
//$pdf->SetTitle('TCPDF Example 001');
//$pdf->SetSubject('<h1>TCPDF Tutorial</h1>');
//$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set default header data
//$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
//$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, '<div style="float:right">haoooooooo</div>', PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
$pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(20);
//echo PDF_MARGIN_FOOTER;exit;
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
require_once dirname(__FILE__) . '/lang/eng.php';
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set default font subsetting mode
$pdf->setFontSubsetting(true);
// Set font
// dejavusans is a UTF-8 Unicode font, if you only need to
// print standard ASCII chars, you can use core fonts like
// helvetica or times to reduce file size.
//$pdf->SetFont('dejavusans', '', 10, '', true);
$pdf->SetFont('Helvetica', '', 10, '', 'false');
// Add a page
// This method has several options, check the source code documentation for more information.
$pdf->AddPage();
// set text shadow effect
$pdf->setTextShadow(array('enabled' => true, 'depth_w' => 1, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 0, 'blend_mode' => 'Normal'));
// Set some content to print
$tbl = '<br /><br/><br/><br/>
<table border="0" cellpadding="2" cellspacing="2" nobr="true">
<tr>
<td style="width:60%"><b>Your Personal Travel Advisor:</b>' . @$results['pdfdata']['adviser_info']['name'] . '</td>
<td style="width:40%"><b>Quote Reference:</b>' . @$results['pdfdata']['adviser_info']['reference'] . '</td>
</tr>
<tr>
<td style="width:60%"><b>Phone Number:</b>' . @$results['pdfdata']['adviser_info']['phone'] . '</td>
<td style="width:40%"><b>Date:</b> ' . @$results['pdfdata']['adviser_info']['date'] . '</td>
</tr>
<tr>
<td style="width:60%"><b>Email Address:</b>' . @$results['pdfdata']['adviser_info']['email'] . '</td>
<td style="width:40%"><b>Adults:</b> ' . @$results['seg'][0]['num_adults'] . ' <b>Children:</b> ' . @$results['seg'][0]['num_children'] . '</td>
</tr>
</table>';
$pdf->writeHTML($tbl, true, false, false, false, '');
//$ci = $results['controller'];
$t = json_decode($results['row'][0]['adults_info'], true);
$tbl = '
<div>
<span>Dear ' . $t['fname'][0] . '</span>
</br>
<p>
I have pleasure in enclosing a quote in respect of your recent enquiry with Super Escapes. Please feel free to contact us, should you need any more information or advice.
</p>
</div>';
$pdf->writeHTML($tbl, true, false, false, false, '');
if (isset($results['fobj'])) {
$depts = fetch_departures();
$arrivs = fetch_arrivals();
$dep_arr = explode('-', $depts[$results['fobj']['@attributes']['depapt']]);
$arr_arr = explode('-', $arrivs[$results['fobj']['@attributes']['arrapt']]);
$ret_arr = explode('-', $depts[$results['fobj']['@attributes']['retapt']]);
$dept_start_time = substr(explode(' ', $results['fobj']['@attributes']['outdep'])[1], 0, -3);
$dept_arr_time = substr(explode(' ', $results['fobj']['@attributes']['outarr'])[1], 0, -3);
$return_start_time = substr(explode(' ', $results['fobj']['@attributes']['indep'])[1], 0, -3);
$return_arr_time = substr(explode(' ', $results['fobj']['@attributes']['inarr'])[1], 0, -3);
$tbl = '
<b><u>Flight Details : </u></b><br><br>
<table border="0" cellpadding="2" cellspacing="2" nobr="true">
<tr>
<th style="width:35%;text-align:center;font-weight:bold;">Route</th>
<td style="width:13%;text-align:center;font-weight:bold;">Dep Date</td>
<td style="width:13%;text-align:center;font-weight:bold;">Dep Time</td>
<td style="width:13%;text-align:center;font-weight:bold;">Arr Date</td>
<td style="width:13%;text-align:center;font-weight:bold;">Arr Time</td>
<td style="width:13%;text-align:center;font-weight:bold;">Flight No</td>
//.........这里部分代码省略.........
示例10: creatNewPdf
function creatNewPdf()
{
$agru = func_get_arg(0);
$logo = $agru['logo'];
$link = $agru['link'];
$target = $agru['target'];
$logoExtention = $agru['logo_extention'];
$date = $agru['date'];
$title = $agru['title'];
$disc = $agru['description'];
$image = $agru['image'];
$content = $agru['content'];
$copyright = $agru['copyright'];
$fileName = $agru['file_name'];
$pdfCreator = $agru['pdf_creator'];
$pdfAuthor = $agru['pdf_author'];
$pdfTitle = $agru['pdf_title'];
$pdfSubject = $agru['pdf_subject'];
$pdfKeywords = $agru['pdf_keywords'];
// create new PDF document
$pdf = new MYPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->setTempRTL('R');
$pdf->image_file = $logo;
$pdf->href = $target;
$pdf->link = $link;
$pdf->copyright = $copyright;
$this->extention = $logoExtention;
# must included in each decument[Must Include]
// appear in document properties
$pdf->SetCreator($pdfCreator);
$pdf->SetAuthor($pdfAuthor);
$pdf->SetTitle($pdfTitle);
$pdf->SetSubject($pdfSubject);
$pdf->SetKeywords($pdfKeywords);
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, ' ', ' ', array(0, 64, 255), array(0, 64, 128));
$pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
// header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// end of header
# set default monospaced font[Must Include]
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
# set margins[Must Include]
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
// header & footer margin
$pdf->SetHeaderMargin(50);
$pdf->SetFooterMargin(20);
$pdf->SetAutoPageBreak(TRUE, 30);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setFontSubsetting(true);
//$pdf->SetFont('almohanad', '', 13);
$pdf->setRTL(true);
// cehck here if ar or en
$pdf->startPageGroup();
$pdf->AddPage();
$lg = array();
$lg['a_meta_charset'] = 'UTF-8';
$lg['a_meta_dir'] = 'rtl';
$pdf->setLanguageArray($lg);
$pdf->SetFont('almohanad', '', 13);
$pdf->setRTL(true);
// cehck here if ar or en
$html = '
<div >
<br/>
<span id="date"style="color:#008080" > ' . $date . ' </span>
<h3 id="title" style="color:#191970"> ' . $title . ' </h3>
<h5 id="description" style="color:#6A5ACD"> ' . $disc . ' </h5>
<img src="' . $image . '" alt="' . $title . '" />
<div style="align:justify"> ' . $content . ' </div>
</div>
';
// $pdf->writeHTML($html, true, false, false, true, "");
$pdf->writeHTMLCell($w = 170, $h = 0, $x = 0, $y = 0, $html, $border = 0, $ln = 0, $fill = false, $reseth = true, $align = "R");
$pdf->setRTL(true);
#excute the file
$pdf->Output(PDF_FILES . $fileName . '.pdf', 'F');
}
示例11: download_consolidated_pdf_report
public function download_consolidated_pdf_report()
{
$user = JFactory::getUser();
$app = JFactory::getApplication();
$model = $this->getModel('survey');
$params = JComponentHelper::getParams(S_APP_NAME);
$id = $app->input->getInt('id', 0);
if (!$id || !$model->authorize_survey($id)) {
CJFunctions::throw_error(JText::_('MSG_UNAUTHORIZED'), 401);
} else {
$wysiwyg = $user->authorise('core.wysiwyg', S_APP_NAME) ? true : false;
$bbcode = $wysiwyg && $params->get('default_editor', 'bbcode') == 'bbcode';
$content = $params->get('process_content_plugins', 0) == 1;
require_once JPATH_COMPONENT . '/helpers/reports.php';
$generator = new SurveyReports($wysiwyg, $bbcode, $content);
$survey = $model->get_consolidated_report($id);
$headStyles = array();
$headStyles[] = CJLIB_URI . '/bootstrap/css/bootstrap.min.css';
$headStyles[] = JURI::root(true) . '/media/' . S_APP_NAME . '/css/cj.surveys.min.css';
$headScripts = array();
$headScripts[] = CJLIB_URI . '/jquery/jquery.min.js';
$headScripts[] = CJLIB_URI . '/jquery/jquery.noconflict.js';
$headScripts[] = CJLIB_URI . '/bootstrap/js/bootstrap.min.js';
$headScripts[] = 'https://www.google.com/jsapi';
$headScripts[] = JURI::root(true) . '/media/' . S_APP_NAME . '/js/cj.surveys.min.js';
$html = '<html xmlns="http://www.w3.org/1999/xhtml" dir="' . JFactory::getDocument()->direction . '"><head>';
$html = $html . '<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta http-equiv="content-type" content="text/html; charset=utf-8" />';
// foreach ($headStyles as $style)
// {
// $html = $html . '<link rel="stylesheet" href="'.$style.'" type="text/css" />';
// }
// foreach ($headScripts as $script)
// {
// $html = $html . '<script src="'.$script.'" type="text/javascript"></script>';
// }
// $html .= '<script type="text/javascript">google.load("visualization", "1", {packages:["corechart"]}); google.setOnLoadCallback(SurveyFactory.draw_consolidated_charts);</script>';
$html .= '</head><body><div id="cj-wrapper" class="container-fuild"><div class="reports-wrapper margin-top-20">';
$html .= '<h2 class="page-header margin-bottom-10">' . CJFunctions::escape($survey->title) . '</h2>';
foreach ($survey->questions as $item) {
switch ($item->question_type) {
case 1:
$html .= $generator->get_page_header_question($item, '');
break;
case 2:
case 3:
case 4:
case 11:
case 12:
$html .= $generator->get_choice_question($item, '');
break;
case 5:
case 6:
$html .= $generator->get_grid_question($item, '');
break;
}
}
$html .= '</div></div></body></html>';
// All validations done, write data now
$fileName = 'survey_' . $id . '_' . date('dmYHis') . '.pdf';
// create new PDF document
require_once JPATH_COMPONENT_SITE . '/helpers/tcpdf.php';
$pdf = new MYPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set default header data
$pdf->SetHeaderData('logo.png', PDF_HEADER_LOGO_WIDTH, $survey->title, '');
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('corejoomla.com');
$pdf->SetTitle('Survey Report');
$pdf->SetSubject('Consolidated Report');
$pdf->SetKeywords('survey, report');
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// ---------------------------------------------------------
// set font
$pdf->SetFont('freesans');
$pdf->AddPage();
$pdf->writeHTML($html, true, false, true, false, '');
$pdf->lastPage();
$pdf->Output($fileName, $mode);
jexit();
}
}
示例12: actionCetaklaporan
public function actionCetaklaporan($nopol, $tgl_awal, $tgl_akhir, $jenis)
{
$criteria = new CDbCriteria();
if (!empty($tgl_awal) && empty($tgl_akhir)) {
$criteria->condition = "TGL_PERBAIKAN>='{$tgl_awal}'";
} else {
if (empty($tgl_awal) && !empty($tgl_akhir)) {
$criteria->condition = "TGL_PERBAIKAN<='{$tgl_akhir}'";
} else {
if (!empty($tgl_awal) && !empty($tgl_akhir)) {
$criteria->condition = "TGL_PERBAIKAN>='{$tgl_awal}' and TGL_PERBAIKAN<='{$tgl_akhir}'";
}
}
}
$criteria->with = array('iDKENDARAAN');
$criteria->compare('iDKENDARAAN.NOPOL', $nopol, true);
$criteria->compare('JENIS_PERBAIKAN', $jenis);
$model = Perbaikan::model()->findAll($criteria);
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
spl_autoload_register(array('YiiBase', 'autoload'));
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetTitle("Laporan Rekap Perbaikan");
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->SetFont('helvetica', '', 8);
$pdf->SetTextColor(80, 80, 80);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->AddPage();
$pdf->setJPEGQuality(75);
$html = <<<EOD
\t\t<h1 align="center">LAPORAN PERBAIKAN</h1>
\t\t<table align="left" border="1" cellpadding="2" cellspacing="0">
\t\t\t<tbody>
\t\t\t\t<tr>
\t\t\t\t\t<td width="40" align="center">NO</td>
\t\t\t\t\t<td width="75" align="center">Nopol Kendaraan</td>
\t\t\t\t\t<td width="65" align="center">Tanggal Perbaikan</td>
\t\t\t\t\t<td width="150" align="center">Kerusakan</td>
\t\t\t\t\t<td width="75" align="center">Estimasi Waktu Perbaikan (hari)</td>
\t\t\t\t\t<td width="75" align="center">Jenis Perbaikan</td>
\t\t\t\t\t<td width="75" align="center">Status</td>
\t\t\t\t\t<td width="75" align="center">PJ Mekanik</td>
\t\t\t\t</tr>
EOD;
$no_urut = 0;
foreach ($model as $mod) {
$no_urut++;
$nopol = $mod->iDKENDARAAN->NOPOL;
$jenis_perbaikan = "";
if ($mod->JENIS_PERBAIKAN == 0) {
$jenis_perbaikan = "Perbaikan";
} else {
if ($mod->JENIS_PERBAIKAN == 1) {
$jenis_perbaikan = "Penggantian";
} else {
if ($mod->JENIS_PERBAIKAN == 2) {
$jenis_perbaikan = "Perbaikan dan Penggantian";
}
}
}
$tgl_perb = "";
if ($mod->TGL_PERBAIKAN != "0000-00-00") {
$tgl_perb = date("d-M-y", strtotime($mod->TGL_PERBAIKAN));
} else {
$tgl_perb = '-';
}
$html .= <<<EOD
\t\t\t\t<tr>
\t\t\t\t\t<td width="40" align="center">{$no_urut}</td>
\t\t\t\t\t<td width="75" align="center">{$nopol}</td>
\t\t\t\t\t<td width="65" align="center">{$tgl_perb}</td>
\t\t\t\t\t<td width="150" align="center">{$mod->KERUSAKAN}</td>
\t\t\t\t\t<td width="75" align="center">{$mod->ESTIMASI_WAKTU_PERBAIKAN}</td>
\t\t\t\t\t<td width="75" align="center">{$jenis_perbaikan}</td>
\t\t\t\t\t<td width="75" align="center">{$mod->STATUS}</td>
\t\t\t\t\t<td width="75" align="center">{$mod->PJ_MEKANIK}</td>
\t\t\t\t</tr>
EOD;
}
$html .= <<<EOD
\t\t\t</tbody>
\t\t</table>
EOD;
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
$filename = Yii::getPathOfAlias('webroot') . '/laporan/perbaikan/rekap perbaikan tanggal ' . date('d-M-y') . '.pdf';
$pdf->Output($filename, 'F');
//Yii::app()->end();
$this->redirect(Yii::app()->request->baseUrl . '/laporan/perbaikan/rekap perbaikan tanggal ' . date('d-M-y') . '.pdf');
}
示例13: setup_pdf
public function setup_pdf()
{
//echo "setup_pdf";
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Havering Carepoint');
$pdf->SetTitle($this->post_title);
$pdf->SetSubject($this->post_title);
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, '', '');
// // set header and footer fonts
// $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
// $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// // set default monospaced font
// $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// // set image scale factor
// $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// // set font
// $pdf->SetFont('dejavusans', '', 10);
// add a page
$pdf->AddPage();
// output the HTML content
$html = '<h1>'.$this->post_title.'</h1>'.apply_filters('the_content', $this->post_content);
$html .= '<br/><small>This PDF was downloaded from: <a href="'.get_permalink($this->post_id).'">'.get_permalink($this->post_id).'</a></small>';
if(get_field('nhs_choices', $this->post_id) != ""):
$html .= '<style>
.nhs-choices-label{
float: left;
display: block;
padding: 5px;
margin-bottom: 20px;
border: 3px solid #DFDFDF;}
</style>
<table class="nhs-choices-label">
<tr>
<td>
<small>This article is sourced from:</small>
<img src="'.get_bloginfo("template_url").'/library/images/nhs-choices-logo.jpg" alt="NHS Choices">
</td>
</tr>
</table>';
endif;
$pdf->writeHTML($html, true, false, true, false, '');
// reset pointer to the last page
$pdf->lastPage();
//Close and output PDF document
$pdf->Output($this->post_title.'.pdf', 'I');
}
示例14: printToServer
function printToServer($content, $name, $client, $folder_name, $version)
{
//$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->setVersion($version);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Ignitor Labs');
$pdf->setHeaderFont(false);
$pdf->setPrintHeader(false);
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
// $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
require_once dirname(__FILE__) . '/lang/eng.php';
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// add a page
$pdf->AddPage();
// set font
$pdf->SetFont('times', 'BI', 20, '', 'false');
//$pdf->Write(0, 'Example of HTML Justification', '', 0, 'L', true, 0, false, false, 0);
// create some HTML content
$html = $content;
// set core font
$pdf->SetFont('helvetica', '', 10);
// output the HTML content
$pdf->writeHTML($html, true, 0, true, true);
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('assets/contracts/' . $folder_name . '/' . $client . '_' . $name . '.pdf', 'F');
}
示例15: MYPDF
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
//$pdf->SetHeaderData($imm, 160);
// set default header data
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, 10, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(FALSE);
$pdf->SetPrintFooter(false);
//set image scale factor
//$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$count = 0;
// add a page
$hea = 'Header Information';
//$pdf->writeHTML($hea, true, 0, true, 0);
$pdf->AddPage();
$pkt11 = 'sagdfsadfashfdhasdhfhfghf';
$pdf->writeHTML($pkt11, true, 0, true, 0);
$pdf->SetFont('helvetica', '', 12);