本文整理汇总了PHP中TCPDF::SetDisplayMode方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF::SetDisplayMode方法的具体用法?PHP TCPDF::SetDisplayMode怎么用?PHP TCPDF::SetDisplayMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCPDF
的用法示例。
在下文中一共展示了TCPDF::SetDisplayMode方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fake_pdf
public function fake_pdf()
{
$this->load->helper('pdf_helper');
$this->load->library('users/auth');
$html_content = '<h4>Le FAKE EN PDF</h4>';
tcpdf();
$obj_pdf = new TCPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF_8', false);
$obj_pdf->SetCreator(PDF_CREATOR);
$title = 'Export PDF';
$obj_pdf->SetTitle($title);
$obj_pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, $title, PDF_HEADER_STRING);
$obj_pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$obj_pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$obj_pdf->SetDefaultMonospacedFont('helvetica');
$obj_pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$obj_pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$obj_pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$obj_pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$obj_pdf->SetFont('helvetica', '', 9);
$obj_pdf->setFontSubsetting(false);
$obj_pdf->AddPage();
ob_start();
// we can have any view part here like HTML, PHP etc
$content = $html_content;
ob_end_clean();
$obj_pdf->writeHTML($content, true, false, true, false, '');
$obj_pdf->SetDisplayMode('real', 'default');
$obj_pdf->Output('output.pdf', 'D');
//$this->output->set_content_type('application/json')->set_output(json_encode($html_content));
//Template::render();
}
示例2: list
/**
* Class constructor
*
* @param mixed $paper The size of paper to use either a string (see {@link CPDF_Adapter::$PAPER_SIZES}) or
* an array(xmin,ymin,xmax,ymax)
* @param string $orientation The orientation of the document (either 'landscape' or 'portrait')
* @param DOMPDF $dompdf
*/
function __construct($paper = "letter", $orientation = "portrait", DOMPDF $dompdf)
{
//***
if (is_array($paper)) {
$size = $paper;
} else {
if (isset(self::$PAPER_SIZES[mb_strtolower($paper)])) {
$size = self::$PAPER_SIZES[mb_strtolower($paper)];
} else {
$size = self::$PAPER_SIZES["letter"];
}
}
$ori = 'P';
// ***
if (mb_strtolower($orientation) === "landscape") {
list($size[2], $size[3]) = array($size[3], $size[2]);
$ori = 'L';
// ***
}
$this->_width = $size[2] - $size[0];
$this->_height = $size[3] - $size[1];
$this->_dompdf = $dompdf;
//***$this->_pdf = new My_TCPDF('P', 'pt', $paper, true, 'UTF-8', false);
$this->_pdf = new My_TCPDF($ori, 'pt', $paper, true, 'UTF-8', false);
// ***
$this->_pdf->SetCreator("DOMPDF Converter");
// CreationDate and ModDate info are added by TCPDF itself
// don't use TCPDF page defaults
$this->_pdf->SetAutoPageBreak(false);
$this->_pdf->SetMargins(0, 0, 0, true);
$this->_pdf->setPrintHeader(false);
// remove default header/footer
$this->_pdf->setPrintFooter(false);
$this->_pdf->setHeaderMargin(0);
$this->_pdf->setFooterMargin(0);
$this->_pdf->SetCellPadding(0);
$this->_pdf->AddPage();
$this->_pdf->SetDisplayMode('fullpage', 'continuous');
$this->_page_number = $this->_page_count = 1;
$this->_page_text = array();
$this->_pages = array($this->_pdf->PageNo());
$this->_image_cache = array();
// other TCPDF stuff...
$this->_objs = array();
// for templating support
$this->_nameddest = array();
// for internal link support
$this->_internal_links = array();
// " " "
$this->_pdf->setAlpha(1.0);
$this->_currentLineTransparency = array("mode" => "Normal", "opacity" => 1.0);
$this->_currentFillTransparency = array("mode" => "Normal", "opacity" => 1.0);
$this->_last_fill_color = $this->_last_stroke_color = null;
//dompdf_debug("trace", "Exit");
}
示例3: strtoupper
$hasil = $key->status;
}
$obj_pdf->SetTitle($toko);
$obj_pdf->SetHeaderData("", "", "", "");
$obj_pdf->SetPrintHeader(FALSE);
$obj_pdf->SetPrintFooter(FALSE);
$obj_pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', 9));
$obj_pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$obj_pdf->SetDefaultMonospacedFont('helvetica');
$obj_pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$obj_pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$obj_pdf->SetMargins(10, 34, 10);
$obj_pdf->SetAutoPageBreak(FALSE, PDF_MARGIN_BOTTOM);
$obj_pdf->SetFont('helvetica', '', 10);
$obj_pdf->setFontSubsetting(FALSE);
$obj_pdf->SetDisplayMode('fullpage', 'SinglePage', 'UseNone');
$obj_pdf->AddPage();
$obj_pdf->SetFont("helvetica", '', 20);
$obj_pdf->Ln(107);
$obj_pdf->MultiCell(180, 10, $no, 0, 'C', 0, 1, '', '', true, 0, false, true, 10, 'B');
$obj_pdf->Ln(30);
$obj_pdf->SetFont($fontnama, '', 22);
$obj_pdf->MultiCell(220, 10, $nama, 0, 'C', 0, 1, '', '', true, 0, false, true, 10, 'B');
$obj_pdf->Ln(5);
$obj_pdf->SetFont('helvetica', '', 12);
$obj_pdf->MultiCell(75, 8, "", 0, 'L', 0, 0, '', '', true, 0, false, true, 8, 'B');
$obj_pdf->MultiCell(50, 8, $tgl, 0, 'L', 0, 0, '', '', true, 0, false, true, 8, 'B');
$obj_pdf->MultiCell(20, 8, "", 0, 'L', 0, 0, '', '', true, 0, false, true, 8, 'B');
$obj_pdf->MultiCell(40, 8, strtoupper($tempat), 0, 'L', 0, 1, '', '', true, 0, false, true, 9, 'B');
$obj_pdf->Ln(7);
$obj_pdf->MultiCell(120, 8, "", 0, 'L', 0, 0, '', '', true, 0, false, true, 8, 'B');
示例4:
$cadena .= "<tr><td>" . $p['u'] . "</td><td>" . $p['uni'] . "</td><td>" . $p['respondidas'] . "</td><td>" . $p['no_respondidas'] . "</td><td>" . $p['sin_responder'] . "</td><td>" . $p['cant'] . "</td></tr>";
}
}
}
break;
case "usc":
//$cadena .= "<tr><td>".$p['pin']."</td><td>Universidad Santiago de Cali</td><td>".$p['fecha_de_creacion_pin']."</td><td>".$p['fecha_de_fin_de_diligenciada_la_encuesta']."</td></tr>";
if ($p['fecha_de_creacion_pin'] != '') {
$cadena .= "<tr><td>" . $p['pin'] . "</td><td>Universidad Santiago de Cali</td><td>" . $p['fecha_de_creacion_pin'] . "</td><td>" . $p['fecha_de_fin_de_diligenciada_la_encuesta'] . "</td></tr>";
} else {
if ($p['tipo'] == 'f1') {
$cadena .= "<tr><td>" . $p['u'] . "</td><td>" . $p['f'] . "</td><td>" . $p['respondidas'] . "</td><td>" . $p['no_respondidas'] . "</td><td>" . $p['sin_responder'] . "</td><td>" . $p['cant'] . "</td></tr>";
} else {
if ($p['tipo'] == 'p1') {
$cadena .= "<tr><td>" . $p['f'] . "</td><td>" . $p['p'] . "</td><td>" . $p['respondidas'] . "</td><td>" . $p['no_respondidas'] . "</td><td>" . $p['sin_responder'] . "</td><td>" . $p['cant'] . "</td></tr>";
} else {
$cadena .= "<tr><td>" . $p['u'] . "</td><td>" . $p['uni'] . "</td><td>" . $p['respondidas'] . "</td><td>" . $p['no_respondidas'] . "</td><td>" . $p['sin_responder'] . "</td><td>" . $p['cant'] . "</td></tr>";
}
}
}
break;
}
}
$cadena .= "</tbody></table>";
//$cadena .= '<center><div><img src="img20.png" alt="attribute" width="500" height="70" border="0" ></div></center>';
$pdf->writeHTML($cadena, false, false, false, true, '');
$pdf->SetDisplayMode('fullpage');
$pdf->Output('codigos_de_acceso.pdf', 'I');
// $pdf->SetFont('Arial', 'I', 12);
//$pdf->Output('prueba.pdf', 'd');
// $pdf->Output();
示例5: salary_emp
/**
* function name : salary_emp
* get data รวมเงินเดือน ลูกจ้างชั่วคราว-พกส.(ปฏิบัติงาน) รายคน
*
*/
public function salary_emp()
{
if (Session::get('level') != '') {
$pdf = new TCPDF();
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->SetDisplayMode('fullpage', 'SinglePage', 'UseNone');
$n = DB::select('select * from s_general_data');
foreach ($n as $k) {
$name = $k->name;
}
$sql = ' select concat(n.pname,"",n.fname," ",n.lname) as name,salary, salary_other ';
$sql .= ' , salary_sso, salary_cpk ';
$sql .= ' , save, shop, rice ';
$sql .= ' , water, elec, other ';
$sql .= ' from n_datageneral n ';
$sql .= ' inner join s_salary_detail s on s.cid=n.cid where month(s.order_date)=' . $this->max_month() . ' and year(s.order_date)=' . $this->max_year() . ' order by n.datainfoID asc';
$result = DB::select($sql);
$i = 0;
$n = 0;
foreach ($result as $key) {
$i++;
$n++;
if ($i == 5) {
$i = 0;
$i++;
}
if ($i == 1) {
$pdf->AddPage('L', 'letter');
}
$linestyle03 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '5,10,5,10', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(0.4, 210, 0.4, 0, $linestyle03);
$linestyle00 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '5,10,5,10', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(68, 210, 68, 0, $linestyle00);
$linestyle01 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '5,10,5,10', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(136, 210, 136, 0, $linestyle01);
$linestyle02 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '5,10,5,10', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(204, 210, 204, 0, $linestyle02);
$linestyle04 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '5,10,5,10', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(272, 210, 272, 0, $linestyle04);
if ($i == 1) {
$pdf->SetY(9);
$pdf->SetX(1);
}
if ($i == 2) {
$pdf->SetY(9);
$pdf->SetX(69);
}
if ($i == 3) {
$pdf->SetY(9);
$pdf->SetX(137);
}
if ($i == 4) {
$pdf->SetY(9);
$pdf->SetX(205);
}
$pdf->SetFont('freeserif', '', 14, '', true);
$pdf->MultiCell(66, 5, $name, 0, 'C', 0, 1, '', '', true);
if ($i == 1) {
$pdf->SetY(15);
$pdf->SetX(1);
}
if ($i == 2) {
$pdf->SetY(15);
$pdf->SetX(69);
}
if ($i == 3) {
$pdf->SetY(15);
$pdf->SetX(137);
}
if ($i == 4) {
$pdf->SetY(15);
$pdf->SetX(205);
}
$pdf->MultiCell(66, 5, 'ประจำเดือน ' . $this->get_monthyearThai($this->max_month(), $this->max_year()), 0, 'L', 0, 1, '', '', true);
if ($i == 1) {
$pdf->SetY(18);
$pdf->SetX(1);
}
if ($i == 2) {
$pdf->SetY(18);
$pdf->SetX(69);
}
if ($i == 3) {
$pdf->SetY(18);
$pdf->SetX(137);
}
if ($i == 4) {
$pdf->SetY(18);
$pdf->SetX(205);
}
$pdf->MultiCell(70, 5, '__________________________', 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', '', 12, '', true);
if ($i == 1) {
$pdf->SetY(25);
//.........这里部分代码省略.........
示例6:
$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 display mode
$pdf->SetDisplayMode($zoom = 'fullpage', $layout = 'TwoColumnRight', $mode = 'UseNone');
// set pdf viewer preferences
$pdf->setViewerPreferences(array('Duplex' => 'DuplexFlipLongEdge'));
// set booklet mode
$pdf->SetBooklet(true, 10, 30);
// set core font
$pdf->SetFont('helvetica', '', 18);
// add a page (left page)
$pdf->AddPage();
$pdf->Write(0, 'Example of booklet mode', '', 0, 'L', true, 0, false, false, 0);
// print a line using Cell()
$pdf->Cell(0, 0, 'PAGE 1', 1, 1, 'C');
// add a page (right page)
$pdf->AddPage();
// print a line using Cell()
$pdf->Cell(0, 0, 'PAGE 2', 1, 1, 'C');
示例7: stripslashes
$bank = stripslashes($_POST['bank']);
$bik = stripslashes($_POST['bik']);
$correspondent_account = stripslashes($_POST['correspondent_account']);
$banknote = stripslashes($_POST['banknote']);
$pence = stripslashes($_POST['pence']);
$order_id = stripslashes($_POST['order_id']);
$amount = stripslashes($_POST['amount']);
//set document properties
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->setPageOrientation('P');
//set font for the entire document
$pdf->SetTextColor(0, 0, 0);
//set up a page
$pdf->AddPage();
$pdf->SetDisplayMode('real');
$pdf->SetFontSize(8);
// ширина квитанции
$width = 190;
// Высота половинки
$height = 75;
// ширина слушебного поля
$field_width = 80;
// Начальные координаты
$x = 10;
$y = 10;
// Первая рамка
$pdf->SetLineStyle(array('dash' => 2));
$pdf->SetXY($x, $y);
$pdf->Cell($width, $height, '', 1, 0, 'C', 0);
$pdf->SetXY($field_width + $x - 40, $y + 5);
示例8:
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
//set margins
$pdf->SetMargins(10, PDF_MARGIN_TOP, 10);
//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);
//initialize document
$pdf->AliasNbPages();
// ---------------------------------------------------------
$pdf->SetDisplayMode("fullpage", "SinglePage", "UseNone");
// set font
$pdf->SetFont('times', "B", 20);
$pdf->AddPage("P", "A4");
$pdf->Cell(0, 0, "A4 PORTRAIT", 1, 1, 'C');
$pdf->AddPage("L", "A4");
$pdf->Cell(0, 0, "A4 LANDSCAPE", 1, 1, 'C');
$pdf->AddPage("P", "A5");
$pdf->Cell(0, 0, "A5 PORTRAIT", 1, 1, 'C');
$pdf->AddPage("L", "A5");
$pdf->Cell(0, 0, "A5 LANDSCAPE", 1, 1, 'C');
$pdf->AddPage("P", "A6");
$pdf->Cell(0, 0, "A6 PORTRAIT", 1, 1, 'C');
$pdf->AddPage("L", "A6");
$pdf->Cell(0, 0, "A6 LANDSCAPE", 1, 1, 'C');
$pdf->AddPage("P", "A7");
示例9: FacilityDataEntryReportPDF
function FacilityDataEntryReportPDF($conn)
{
global $gTEXT;
global $SITETITLE;
$Year = isset($_REQUEST['Year']) ? $_REQUEST['Year'] : '';
$Month = isset($_REQUEST['Month']) ? $_REQUEST['Month'] : '';
$RegionId = isset($_REQUEST['RegionId']) ? $_REQUEST['RegionId'] : '';
$RegionName = isset($_REQUEST['RegionName']) ? $_REQUEST['RegionName'] : '';
$MonthName = isset($_REQUEST['MonthName']) ? $_REQUEST['MonthName'] : '';
$ItemGroupName = isset($_REQUEST['ItemGroupName']) ? $_REQUEST['ItemGroupName'] : '';
$lastyear = getYearForLastMonth($Year, $Month);
$lastmonth = getLastMonth($Year, $Month);
$CFMStockId = isset($_REQUEST['CFMStockId']) ? $_REQUEST['CFMStockId'] : '';
$CountryId = isset($_REQUEST['CountryId']) ? $_REQUEST['CountryId'] : '';
//$DistrictId = isset($_REQUEST['DistrictId']) ? $_REQUEST['DistrictId'] : '';
//$OwnerTypeId = isset($_REQUEST['OwnerTypeId']) ? $_REQUEST['OwnerTypeId'] : '';
$Year = isset($_REQUEST['YearId']) ? $_REQUEST['YearId'] : '';
$MonthId = isset($_REQUEST['MonthId']) ? $_REQUEST['MonthId'] : '';
$MonthName = isset($_REQUEST['MonthName']) ? $_REQUEST['MonthName'] : '';
$FacilityId = isset($_REQUEST['FacilityId']) ? $_REQUEST['FacilityId'] : '';
require_once 'tcpdf/tcpdf.php';
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$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->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
require_once dirname(__FILE__) . '/lang/eng.php';
$pdf->setLanguageArray($l);
}
$pdf->SetDisplayMode('fullpage', 'SinglePage', 'UseNone');
$pdf->SetFont('times', 'B', 20);
$pdf->AddPage('L', 'A4');
$sqlf = " SELECT FacilityId, FacilityName FROM t_facility WHERE FacilityId={$FacilityId}";
$resultf = mysql_query($sqlf);
$FacilityName = '';
while ($row = mysql_fetch_array($resultf)) {
$FacilityName = $row['FacilityName'];
}
$html3 = '<div class="padding-md clearfix" style="text-align:center;">
<h2 style="text-align:center;">' . $SITETITLE . '</h2>
<h4 style="text-align:center;">' . $gTEXT['Facility Level Patient And Stock Status List'] . '</h4>
<h5 style="text-align:center;">' . $gTEXT['Facility'] . ': ' . $FacilityName . ',
' . $gTEXT['Month'] . ': ' . $MonthName . ',
' . $gTEXT['Year'] . ': ' . $Year . '<h5>
</div>';
$pdf->SetFont('dejavusans', '', 9);
$pdf->writeHTMLCell(140, 20, 75, 10, $html3, '', 0, 0, false, 'C', true);
//===============================facility data entry Table======================================
function checkNullable($value)
{
$retVal = '';
if ($value == 0) {
$retVal = '';
} else {
$retVal = number_format($value);
}
return $retVal;
}
function checkNull($value)
{
$retVal = '';
if ($value == 0) {
$retVal = '';
} else {
$retVal = $value;
}
return $retVal;
}
$sql1 = " SELECT\n\t b.CFMPOId,\n\t a.FormulationName PatientTypeName,\n\t b.RefillPatient,\n\t b.NewPatient,\n\t b.TotalPatient\n\tFROM t_formulation a\n\t INNER JOIN t_cfm_patientoverview b\n\t\tON a.FormulationId = b.FormulationId\n\tWHERE b.CFMStockId = {$CFMStockId}\n\t\tAND FacilityId = {$FacilityId}\n\t\tAND MonthId = {$MonthId}\n\t\tAND YEAR = '" . $Year . "'\n\t\tAND CountryId = {$CountryId}\n\tORDER BY b.CFMPOId ASC";
$result = mysql_query($sql1);
$total = mysql_num_rows($result);
$sql7 = " SELECT CFMStockId, FacilityId, MonthId, Year, \n\t(SELECT b.name FROM ykx9st_users b WHERE b.username = a.CreatedBy) CreatedBy, DATE_FORMAT(CreatedDt, '%d-%b-%Y %h:%i %p') CreatedDt,\n\t(SELECT b.name FROM ykx9st_users b WHERE b.username = a.LastUpdateBy) LastUpdateBy,\t\n\t(SELECT b.name FROM ykx9st_users b WHERE b.username = a.LastSubmittedBy) LastSubmittedBy ,\n\tc.StatusId, c.StatusName,\n\tDATE_FORMAT(LastUpdateDt, '%d-%b-%Y %h:%i %p') LastUpdateDt,\t\n\tDATE_FORMAT(LastSubmittedDt, '%d-%b-%Y %h:%i %p') LastSubmittedDt,\t\n\tDATE_FORMAT(a.AcceptedDt, '%d-%b-%Y %h:%i %p') AcceptedDt,\t\n\t(SELECT b.name FROM ykx9st_users b WHERE b.username = a.PublishedBy) PublishedBy ,\n\tDATE_FORMAT(a.PublishedDt, '%d-%b-%Y %h:%i %p') PublishedDt \t\n\tFROM t_cfm_masterstockstatus a LEFT JOIN t_status c ON a.StatusId = c.StatusId ";
$sql7 .= " WHERE FacilityId = " . $FacilityId . " and MonthId = " . $MonthId . " and Year = '" . $Year . "' AND CountryId = {$CountryId} ";
$result7 = mysql_query($sql7);
$sql = "SELECT a.CFMStockStatusId, a.FacilityId, a.MonthId, a.Year, a.ItemGroupId, b.ItemSL, a.ItemNo, b.ItemName, OpStock OpStock_A, a.OpStock_C, a.ReceiveQty, a.DispenseQty, a.AdjustQty, a.AdjustId AdjustReason";
$sql .= ",a.StockoutDays, a.StockOutReasonId, a.ClStock ClStock_A, a.ClStock_C, a.ClStockSourceId, a.MOS, a.AMC, a.AMC_C, a.AmcChangeReasonId, a.MaxQty, a.OrderQty, a.ActualQty, a.OUReasonId, \n\t a.UserId, a.LastEditTime, c.ProductSubGroupName FormulationName FROM t_cfm_stockstatus a, t_itemlist b, t_product_subgroup c ";
$sql .= " WHERE a.CFMStockId = {$CFMStockId}\n\t\t\t\tAND `YEAR` = '{$Year}'\n\t\t\t\tAND MonthId = {$MonthId}\n\t\t\t\tAND CountryId = 1\n\t\t\t\tAND a.FacilityId = {$FacilityId}\n\t\t\t\tAND a.ItemNo = b.ItemNo\n\t\t\t\tAND b.ProductSubGroupId = c.ProductSubGroupId ";
$sql .= " ORDER BY b.ItemSL asc";
$r = mysql_query($sql);
$total = mysql_num_rows($r);
if ($total > 0) {
$data = array();
$i = 0;
$getRegimen = '';
$htmlPrint1 = '';
while ($row = mysql_fetch_array($result)) {
$htmlPrint1 .= '<tr nobr="true">
<td style="text-align: left; word-wrap: break-word; width:30px;">' . ++$i . '</td>
<td style="text-align: left; word-wrap: break-word; width:100px;">' . $row['PatientTypeName'] . '</td>
<td style="text-align: right; width:40px;">' . checkNullable($row['TotalPatient']) . '</td>
</tr>';
}
$htmlC1 = '
<style>
//.........这里部分代码省略.........
示例10: testPdfOutput
public function testPdfOutput()
{
// 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 028');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(10, PDF_MARGIN_TOP, 10);
// 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)
$pdf->setLanguageArray($this->langSettings);
// ---------------------------------------------------------
$pdf->SetDisplayMode('fullpage', 'SinglePage', 'UseNone');
// set font
$pdf->SetFont('times', 'B', 20);
$pdf->AddPage('P', 'A4');
$pdf->Cell(0, 0, 'A4 PORTRAIT', 1, 1, 'C');
$pdf->AddPage('L', 'A4');
$pdf->Cell(0, 0, 'A4 LANDSCAPE', 1, 1, 'C');
$pdf->AddPage('P', 'A5');
$pdf->Cell(0, 0, 'A5 PORTRAIT', 1, 1, 'C');
$pdf->AddPage('L', 'A5');
$pdf->Cell(0, 0, 'A5 LANDSCAPE', 1, 1, 'C');
$pdf->AddPage('P', 'A6');
$pdf->Cell(0, 0, 'A6 PORTRAIT', 1, 1, 'C');
$pdf->AddPage('L', 'A6');
$pdf->Cell(0, 0, 'A6 LANDSCAPE', 1, 1, 'C');
$pdf->AddPage('P', 'A7');
$pdf->Cell(0, 0, 'A7 PORTRAIT', 1, 1, 'C');
$pdf->AddPage('L', 'A7');
$pdf->Cell(0, 0, 'A7 LANDSCAPE', 1, 1, 'C');
// --- test backward editing ---
$pdf->setPage(1, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A4 test', 1, 1, 'C');
$pdf->setPage(2, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A4 test', 1, 1, 'C');
$pdf->setPage(3, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A5 test', 1, 1, 'C');
$pdf->setPage(4, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A5 test', 1, 1, 'C');
$pdf->setPage(5, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A6 test', 1, 1, 'C');
$pdf->setPage(6, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A6 test', 1, 1, 'C');
$pdf->setPage(7, true);
$pdf->SetY(40);
$pdf->Cell(0, 0, 'A7 test', 1, 1, 'C');
$pdf->setPage(8, true);
$pdf->SetY(40);
$pdf->Cell(0, 0, 'A7 test', 1, 1, 'C');
$pdf->lastPage();
$this->comparePdfs($pdf);
}
示例11: CreatePDF
function CreatePDF($mysqli, $otchet)
{
// $rus = array('А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я', 'а', 'б', 'в', 'г', 'д', 'е', 'ё', 'ж', 'з', 'и', 'й', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'ш', 'щ', 'ъ', 'ы', 'ь', 'э', 'ю', 'я');
// $lat = array('A', 'B', 'V', 'G', 'D', 'E', 'E', 'Gh', 'Z', 'I', 'Y', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'F', 'H', 'C', 'Ch', 'Sh', 'Sch', 'Y', 'Y', 'Y', 'E', 'Yu', 'Ya', 'a', 'b', 'v', 'g', 'd', 'e', 'e', 'gh', 'z', 'i', 'y', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'f', 'h', 'c', 'ch', 'sh', 'sch', 'y', 'y', 'y', 'e', 'yu', 'ya');
//set document properties
$pdf = new TCPDF('P', 'mm', 'A4', true, 'utf-8');
$pdf->SetMargins(20, 30, 20);
$pdf->AddPage();
$pdf->SetFont('dejavusans', "", 10);
$pdf->SetTitle($otchet);
$pdf->SetXY(20, 50);
$pdf->SetDrawColor(100, 100, 0);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetDisplayMode('real', 'default');
//insert an image and make it a link
///$pdf->Image('logo.png',10,20,33,0,' ','http://www.fpdf.org/');
//display the title with a border around it
$pdf->SetXY(50, 20);
$pdf->Cell(130, 10, $otchet, 1, 0, 'C', 0);
if ($otchet == 'Отчет по Ключевым словам') {
$pdf->SetXY(50, 50);
$pdf->SetFontSize(12);
$pdf->MultiCell(40, 12, 'Номер категории', 1, 'C', 0);
$pdf->SetXY(90, 50);
$pdf->MultiCell(50, 12, 'Категория', 1, 'C', 0);
$pdf->SetXY(140, 50);
$pdf->MultiCell(40, 12, 'Количество просмотров', 1, 'C', 0);
///Таблица статистики
$search = array();
$s = $mysqli->prepare("SELECT * FROM Category1 ORDER BY stat");
$s->execute();
$result = $s->get_result();
$y = 62;
while ($obj = $result->fetch_assoc()) {
$pdf->SetXY(50, $y);
$pdf->SetFontSize(10);
$pdf->MultiCell(40, 20, $obj['id'] . "_1", 1, 'C', 0);
$pdf->SetXY(90, $y);
$pdf->MultiCell(50, 20, $obj['categ'], 1, 'C', 0);
$pdf->SetXY(140, $y);
$pdf->MultiCell(40, 20, $obj['stat'], 1, 'C', 0);
$y += 20;
}
$s = $mysqli->prepare("SELECT * FROM Category2 ORDER BY stat");
$s->execute();
$result = $s->get_result();
while ($obj = $result->fetch_assoc()) {
$pdf->SetXY(50, $y);
$pdf->SetFontSize(10);
$pdf->MultiCell(40, 20, $obj['id2'] . "_2", 1, 'C', 0);
$pdf->SetXY(90, $y);
$pdf->MultiCell(50, 20, $obj['categ2'], 1, 'C', 0);
$pdf->SetXY(140, $y);
$pdf->MultiCell(40, 20, $obj['stat'], 1, 'C', 0);
$y += 20;
}
} else {
$pdf->SetXY(30, 50);
$pdf->SetFontSize(12);
$pdf->MultiCell(40, 10, 'Номер новости', 1, 'C', 0);
$pdf->SetXY(70, 50);
$pdf->MultiCell(50, 10, 'Заголовок новости', 1, 'C', 0);
$pdf->SetXY(120, 50);
$pdf->MultiCell(40, 10, 'Категория', 1, 'C', 0);
$pdf->SetXY(160, 50);
$pdf->MultiCell(30, 10, 'Статистика', 1, 'C', 0);
///Таблица статистики
$sth = $mysqli->prepare("SELECT * FROM News,Category2 WHERE News.id_cat2 = Category2.id2");
$sth->execute();
$result = $sth->get_result();
$y = 60;
while ($obj = $result->fetch_assoc()) {
$pdf->SetXY(30, $y);
$pdf->SetFontSize(10);
$pdf->MultiCell(40, 20, $obj['id'], 1, 'C', 0);
$pdf->SetXY(70, $y);
$pdf->MultiCell(50, 20, $obj['title'] . '...', 1, 'C', 0);
$pdf->SetXY(120, $y);
$pdf->MultiCell(40, 20, $obj['categ2'], 1, 'C', 0);
$pdf->SetXY(160, $y);
$pdf->MultiCell(30, 20, $obj['colview'], 1, 'C', 0);
$y += 20;
}
}
//Output the document
$pdf->OutPut('otchet.pdf');
}
示例12: testPdfOutput
public function testPdfOutput()
{
// 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 040');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 040', 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 (optional)
$pdf->setLanguageArray($this->langSettings);
// ---------------------------------------------------------
// set display mode
$pdf->SetDisplayMode($zoom = 'fullpage', $layout = 'TwoColumnRight', $mode = 'UseNone');
// set pdf viewer preferences
$pdf->setViewerPreferences(array('Duplex' => 'DuplexFlipLongEdge'));
// set booklet mode
$pdf->SetBooklet(true, 10, 30);
// set core font
$pdf->SetFont('helvetica', '', 18);
// add a page (left page)
$pdf->AddPage();
$pdf->Write(0, 'Example of booklet mode', '', 0, 'L', true, 0, false, false, 0);
// print a line using Cell()
$pdf->Cell(0, 0, 'PAGE 1', 1, 1, 'C');
// add a page (right page)
$pdf->AddPage();
// print a line using Cell()
$pdf->Cell(0, 0, 'PAGE 2', 1, 1, 'C');
// add a page (left page)
$pdf->AddPage();
// print a line using Cell()
$pdf->Cell(0, 0, 'PAGE 3', 1, 1, 'C');
// add a page (right page)
$pdf->AddPage();
// print a line using Cell()
$pdf->Cell(0, 0, 'PAGE 4', 1, 1, 'C');
$this->comparePdfs($pdf);
}