本文整理汇总了PHP中Pdf::SetHeaderMargin方法的典型用法代码示例。如果您正苦于以下问题:PHP Pdf::SetHeaderMargin方法的具体用法?PHP Pdf::SetHeaderMargin怎么用?PHP Pdf::SetHeaderMargin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pdf
的用法示例。
在下文中一共展示了Pdf::SetHeaderMargin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GeneraPdf
public function GeneraPdf($html, $nombre)
{
$pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('');
$pdf->SetTitle('');
$pdf->SetSubject('');
$pdf->SetKeywords('');
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . '', PDF_HEADER_STRING, array(255, 255, 255), array(255, 255, 255));
$pdf->SetFooterData($tc = array(0, 64, 0), $lc = array(255, 255, 255));
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$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->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setFontSubsetting(true);
$pdf->SetFont('helvetica', '', 10, '', true);
$pdf->AddPage();
$pdf->writeHTML($html, true, false, true, false, '');
$nombre_archivo = utf8_decode($nombre . date('Y-m-d-His') . ".pdf");
$pdf->Output($nombre_archivo, 'I');
}
示例2: reporte_medicamentos
/** @Functions que permiten generar PDF's con reportes
/**************************************************************************/
public function reporte_medicamentos()
{
// Carga de datos
$data_meds = $this->gestion->get_medicamentos();
$tmp_meds = $this->templates->tmp_reporte_medicamentos($data_meds);
// Generacion de PDF
$pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Sysmedcloud');
$pdf->SetTitle('Reporte de Medicamentos');
$pdf->SetSubject('');
$pdf->SetKeywords('');
$pdf->SetHeaderData('logo.png', PDF_HEADER_LOGO_WIDTH + 20, 'Reporte', 'Medicamentos', array(0, 64, 255), array(0, 64, 128));
$pdf->setFooterData($tc = array(0, 64, 0), $lc = array(0, 64, 128));
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$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->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setFontSubsetting(true);
$pdf->SetFont('Helvetica', '', 8, '', true);
$pdf->AddPage();
$pdf->writeHTML($tmp_meds, true, 0, true, 0);
$nombre_archivo = utf8_decode("reporte-medicamentos-" . date("d") . "_" . date("m") . "_" . date("Y") . ".pdf");
$pdf->Output($nombre_archivo, 'I');
}
示例3: index
function index()
{
$this->load->library('Pdf');
$userdata = $this->session->all_userdata();
$data['email'] = $userdata['email'];
$this->load->model('tenants_model');
$data['tenant_detail'] = $this->tenants_model->get_unit($data['email']);
$pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->SetTitle('Rent Receipt');
$pdf->SetHeaderMargin(30);
$pdf->SetTopMargin(20);
$pdf->setFooterMargin(20);
$pdf->SetAutoPageBreak(true);
$pdf->SetAuthor('Rentit Agency');
$pdf->SetDisplayMode('real', 'default');
$pdf->AddPage();
$html = <<<EOD
<table cellspacing="3" cellpadding="6" border="">
\t\t
\t\t
EOD;
$pdf->Ln();
$html .= "<tr><td>";
$html .= "<b>RENTIT AGENCY<br />RENT RECEIPT</b>";
$html .= "</td><td>";
$this->load->helper('date');
$datestring = "%Y-%m-%d ";
$date = mdate($datestring);
$html .= "<b>Date Received: </b> {$date} <br />";
$html .= "<br /><b>Received From: </b> ";
$html .= $userdata['email'];
'<br />';
$html .= "<br /><br/><b>The sum of: </b> KeS ";
$html .= $userdata['amount'];
'<br />';
$html .= "</td></tr>";
$html .= "<tr><td colspan=2>";
$html .= "<b>For Rent at:</b> ";
$html .= $data['tenant_detail'][0]['block_name'];
$html .= " house, ";
$html .= $data['tenant_detail'][0]['unitname'];
',';
$html .= "<br /><br /><b>Rent Period Starting</b>: ";
$html .= $data['tenant_detail'][0]['occupation_date'];
',<br />';
$html .= "<br /><br /><b>Received by: </b> Rentit Agency";
$html .= "</td></tr>";
$html .= "</table>";
$pdf->writeHTML($html, true, false, false, false, '');
ob_clean();
$pdf->Output('Receipt.pdf', 'I');
}
示例4: print_brgy_leaders
public function print_brgy_leaders($voter_data = array(), $data = array())
{
$this->load->library('pdf');
$pdf = new Pdf('L', 'mm', 'LETTER', true, 'UTF-8', false);
$pdf->SetTitle('My Title');
$pdf->SetHeaderMargin(30);
$pdf->SetTopMargin(20);
$pdf->setFooterMargin(10);
$pdf->SetAutoPageBreak(true, 15);
$pdf->SetAuthor('Author');
$pdf->AddPage('L', 'LEGAL');
$pdf->setY(30);
$html = '';
$html .= '<div style="text-align: center;"><b>Brgy Leaders</b> for<br/><b>' . $data['brgy'] . '</b></div>';
$html .= '<br/>';
$html .= '<br/>';
$html .= '<table style="border: 1px solid #000;border-collapse: collapse;" border="1" cellspacing="0" cellpadding="1">';
$html .= '<thead>';
$html .= '<tr style="background-color: #a8a8a8;">';
$html .= '<th align="center" width="5%"></th>';
$html .= '<th align="center" width="45%"><b>Voter\'s Name</b></th>';
$html .= '<th align="center" width="30%"><b>Precinct No</b></th>';
$html .= '<th align="center" width="20%"><b>Type</b></th>';
$html .= '</tr>';
$html .= '</thead>';
if (count($voter_data) > 0) {
$x = 1;
foreach ($voter_data as $type => $val) {
for ($ctr = 0; $ctr < count($val); $ctr++) {
$html .= '<tr nobr="true">';
$html .= '<td align="center" width="5%">' . $x . '.</td>';
$html .= '<td width="45%"> ' . $val[$ctr]['full_name'] . '</td>';
$html .= '<td width="30%"> ' . $val[$ctr]['precinct_no'] . '</td>';
$html .= '<td width="20%"> ' . $val[$ctr]['type'] . '</td>';
$html .= '</tr>';
$x++;
}
}
} else {
$html .= '<tr>';
$html .= '<td align="center" width="100%">No record found..</td>';
$html .= '</tr>';
}
$html .= '</table>';
$pdf->writeHTML($html, true, false, false, false, '');
$pdf->Output('brgy_leaders_report.pdf', 'I');
}
示例5: index
public function index()
{
if (strlen($this->getParam()) == 0) {
App::redirectUrl($this->registry->router->generate('frontend.home', true));
}
$product = App::getModel('product/product')->getProductAndAttributesById((int) $this->registry->core->getParam());
$range = App::getModel('product/product')->getRangeType((int) $this->registry->core->getParam());
App::getModel('product/product')->getPhotos($product);
if (empty($product)) {
App::redirectUrl($this->registry->router->generate('frontend.home', true));
}
$product['photo']['normal'][0] = 'design/' . str_replace(DESIGNPATH, '', $product['photo']['normal'][0]);
$selectAttributes = App::getModel('product/product')->getProductAttributeGroups($product);
$attset = App::getModel('product/product')->getProductVariant($product);
$this->registry->template->assign('product', $product);
$this->registry->template->assign('attributes', $selectAttributes);
$this->registry->template->assign('attset', $attset);
$this->registry->template->assign('ROOTPATH', ROOTPATH);
$htmlcontent = $this->registry->template->fetch($this->loadTemplate('index.tpl'));
$pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Gekosale');
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$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->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setLanguageArray(1);
$pdf->SetFont('dejavusans', '', 10);
$pdf->AddPage();
$pdf->writeHTML($htmlcontent, true, 0, true, 0);
@ob_clean();
$pdf->Output($product['seo'], 'D');
}
示例6: generate_letter_support_pdf
public function generate_letter_support_pdf($arrData, $pData)
{
$this->load->model('setup_model');
$letter = $this->setup_model->get_by(array('name' => 'Letter'));
$ward_letter = $this->setup_model->get_by(array('name' => 'Ward Leader Letter'));
$support_letter = $this->setup_model->get_by(array('name' => 'Letter of Support'));
$this->load->library('pdf');
$pdf = new Pdf('L', 'mm', 'LETTER', true, 'ISO-8859-1', false);
$pdf->SetTitle($pData['brgy'] . '-LETTER-' . date("YmdHis"));
$pdf->SetHeaderMargin(0);
$pdf->SetTopMargin(10);
$pdf->SetLeftMargin(20);
$pdf->SetRightMargin(20);
$pdf->setFooterMargin(10);
$pdf->SetAutoPageBreak(true, 10);
$pdf->SetFontSize(10);
$pdf->SetAuthor('Author');
// set font
$pdf->SetFont('freeserif', '', 10);
$ctr = 0;
foreach ($arrData as $result) {
if ($ctr % 2 == 0) {
$pdf->AddPage('P', 'LEGAL');
$pdf->setY(15);
} else {
$pdf->setY(190);
}
$result = (object) $result;
$voter_name = explode(",", htmlentities($result->full_name));
$html = "";
$html .= "<br/>";
$html .= '<b>' . trim(htmlentities($result->full_name)) . '</b>';
$html .= "<br/>";
$html .= '<b>' . trim($result->brgy) . '</b>';
$html .= "<br/>";
$html .= '<b>' . trim($result->precinct) . '</b>';
$html .= "<br/>";
$html .= "<br/>";
$html .= 'Minamahal na <b>' . (trim($result->gender) == 'M' ? 'G.' : 'Bb/Gng.') . " " . ucfirst(trim(strtolower(htmlentities($voter_name[0])))) . ":</b>";
$html .= "<br/>";
// $html .= $is_ward ? $ward_letter['content'] : $letter['content'];
$html .= $support_letter['content'];
$html .= "<br/>";
$html .= '<table>' . '<tr>' . '<td width="60%"></td>' . '<td>Gumagalang, </td>' . '</tr>' . '<tr>' . '<td width="60%"></td>' . '</tr>' . '<tr>' . '<td width="50%" align="center"><b> <img src="' . base_url('assets/images/alexander_pajarillo_sign.jpg') . '" height="55" width="150"/></b></td>' . '<td width="50%" align="center"><b> <img src="' . base_url('assets/images/edgardo_tallado_sign.jpg') . '" height="55" width="150"/></b></td>' . '</tr>' . '<tr>' . '<td width="50%" align="center"><i>Mayor</i></td>' . '<td width="50%" align="center"><i>Governor</i></td>' . '</tr>' . '<tr>' . '<td width="60%"></td>' . '</tr>' . '<tr>' . '<td width="100%" align="center"><u> <b>' . trim(htmlentities($result->full_name)) . '</b> </u></td>' . '</tr>' . '<tr>' . '<td width="100%" align="center">Lagda</td>' . '</tr>' . '</table>';
$pdf->writeHTML($html, true, false, false, false, '');
$ctr++;
// if($ctr == 1){
// $pdf->setY(100);
// $ctr = 0;
// }
}
$pdf->Output('letter.pdf', 'I');
exit;
pe($letter);
}
示例7: generarSalidaEmpleados
public function generarSalidaEmpleados()
{
$departamento = $this->input->get("departamento") != 'null' ? '=' . $this->input->get("departamento") : 'LIKE "%"';
$nacionalidad = $this->input->get("nacionalidad") != '' ? "LIKE '%" . $this->input->get("nacionalidad") . "%'" : 'LIKE "%"';
$cedula = $this->input->get("cedula") != '' ? '=' . $this->input->get("cedula") : 'LIKE "%"';
$nombre = $this->input->get("nombre") != '' ? "LIKE '%" . $this->input->get("nombre") . "%'" : 'LIKE "%"';
$apellido = $this->input->get("apellido") != '' ? "LIKE '%" . $this->input->get("apellido") . "%'" : 'LIKE "%"';
$pdf = new Pdf('l', 'mm', 'A4', true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetSubject('Tutorial TCPDF');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH1, PDF_HEADER_TITLE, PDF_HEADER_STRING);
$pdf->setFooterData($tc = array(0, 64, 0), $lc = array(0, 64, 128));
// datos por defecto de cabecera, se pueden modificar en el archivo tcpdf_config.php de libraries/config
// $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH,'Listado General',PDF_HEADER_STRING,array(0,64,255), array(0,64,128));
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetPageOrientation('p');
// se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//relación utilizada para ajustar la conversión de los píxeles
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// establecer el modo de fuente por defecto
$pdf->setFontSubsetting(true);
$pdf->AddPage();
$html = null;
$nombre_archivo = null;
$username = $this->session->userdata('datasession');
if ($username['idusuario'] == 13) {
$resultado2 = $this->ReporteGeneral_model->getdptoempleadosdos($nacionalidad, $cedula, $nombre, $apellido, $departamento);
} else {
$resultado2 = $this->ReporteGeneral_model->getdptoempleados($nacionalidad, $cedula, $nombre, $apellido, $username['idusuario']);
$resultado = $this->ReporteGeneral_model->getsalidasempleados($nacionalidad, $cedula, $nombre, $apellido, $username['idusuario']);
}
if ($resultado2->num_rows() > 0) {
foreach ($resultado2->result_array() as $fila2) {
if ($username['idusuario'] == 13) {
$resultado = $this->ReporteGeneral_model->getsalidasempleadosdos($nacionalidad, $cedula, $nombre, $apellido, $fila2['departamento']);
} else {
$resultado = $this->ReporteGeneral_model->getsalidasempleados($nacionalidad, $cedula, $nombre, $apellido, $username['idusuario']);
}
$pdf->SetFont('Times', 'B', 14);
$pdf->Text(14, 25, 'Departamento: ' . $fila2['nombre']);
$pdf->SetFont('Times', 'B', 12);
$pdf->Text(50, 35, 'Resumen de autorización(es) por empleado(s).');
$pdf->Ln(15);
$pdf->SetFont('times', '', 11, '', true);
$pdf->SetFillColor('150', '210', '255');
$pdf->Cell(20, 0, 'Cédula', 1, 0, 'C', 1);
$pdf->Cell(60, 0, 'Nombres y Apellidos', 1, 0, 'C', 1);
$pdf->Cell(20, 0, 'Personal', 1, 0, 'C', 1);
$pdf->Cell(20, 0, 'Laboral', 1, 0, 'C', 1);
$pdf->Cell(20, 0, 'Medico', 1, 0, 'C', 1);
$pdf->Cell(20, 0, 'Estudio', 1, 0, 'C', 1);
$pdf->Cell(20, 0, 'Sindical', 1, 0, 'C', 1);
$pdf->Cell(10, 0, 'Total', 1, 1, 'C', 1);
$cedemp = 'null';
$motivo = array();
$tot = 0;
foreach ($resultado->result_array() as $fila) {
$tot = $tot + 1;
if ($cedemp != $fila['cedula']) {
if ($cedemp != 'null') {
$result = 0;
foreach ($motivo as $re) {
if ($re != 0) {
$result = $result + $re;
}
$pdf->Cell(20, 0, $re, 1, 0, 'C', 0, '', 0);
}
$pdf->Cell(10, 5, $result, 1, 1, 'C', 1);
unset($motivo);
$motivo = array();
$pdf->Cell(20, 0, $fila['cedula'], 1, 0, 'C', 0, '', 1);
$pdf->Cell(60, 0, $fila['nombre'] . ' ' . $fila['apellido'], 1, 0, 'C', 0, '', 1);
$mot1 = $fila["Personal"];
$mot2 = $fila["Laboral"];
$mot3 = $fila["Medico"];
$mot4 = $fila["Estudio"];
$mot5 = $fila["Sindical"];
array_push($motivo, $mot1, $mot2, $mot3, $mot4, $mot5);
$cedemp = $fila['cedula'];
} else {
if ($tot == 1) {
$pdf->Cell(20, 0, $fila['cedula'], 1, 0, 'C', 0, '', 1);
$pdf->Cell(60, 0, $fila['nombre'] . ' ' . $fila['apellido'], 1, 0, 'C', 0, '', 1);
$mot1 = $fila["Personal"];
$mot2 = $fila["Laboral"];
$mot3 = $fila["Medico"];
$mot4 = $fila["Estudio"];
$mot5 = $fila["Sindical"];
array_push($motivo, $mot1, $mot2, $mot3, $mot4, $mot5);
$cedemp = $fila['cedula'];
}
//.........这里部分代码省略.........
示例8: pdf
//.........这里部分代码省略.........
if ($data['villa'] == '') {
$data['villa'] = '----';
}
$data['entrada'] = $this->input->post('entrada');
if ($data['entrada'] == '') {
$data['entrada'] = '----';
}
$data['colonia'] = $this->input->post('colonia');
if ($data['colonia'] == '') {
$data['colonia'] = '----';
}
$data['delegacion'] = $this->input->post('delegacion');
if ($data['delegacion'] == '') {
$data['delegacion'] = '----';
}
$data['cp'] = $this->input->post('cp');
if ($data['cp'] == '') {
$data['cp'] = '----';
}
$this->load->library('Pdf');
$pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Cony Jaramillo');
$pdf->SetTitle('Documentos Prepa Si');
$pdf->SetSubject('Reimpresión de Documentos');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
ob_start();
//remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
// set default header 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 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);
}
///////////////////////////////////////////////////---------------///////////////////////////////////////////////////
///////////////////////////////////////////////////FORMATO ENTREGA///////////////////////////////////////////////////
///////////////////////////////////////////////////---------------///////////////////////////////////////////////////
// establecer el modo de fuente por defecto
$pdf->setFontSubsetting(true);
// Establecer el tipo de letra
$pdf->SetFont('helvetica', '', 10);
//Normal
$arriba = 6;
$izq = 10;
$der = 10;
$pdf->AddPage('L', 'LETTER');
$pdf->SetFont('pdfahelvetica', '', 10);
//Normal
//$pdf->SetFont('pdfahelveticai', '', 10); // S
$pdf->SetTextColor(0, 0, 0);
$style = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,20,5,10', 'phase' => 10, 'color' => array(255, 0, 0));
$style2 = array('width' => 0.2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0));
$style3 = array('width' => 0.2, 'cap' => 'round', 'join' => 'round', 'dash' => '2,10', 'color' => array(0, 0, 0));
$style4 = array('L' => 0, 'T' => array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => '20,10', 'phase' => 10, 'color' => array(100, 100, 255)), 'R' => array('width' => 0.5, 'cap' => 'round', 'join' => 'miter', 'dash' => 0, 'color' => array(50, 50, 127)), 'B' => array('width' => 0.75, 'cap' => 'square', 'join' => 'miter', 'dash' => '30,10,5,10'));
$style5 = array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 64, 128));
$style6 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,10', 'color' => array(0, 128, 0));
$style7 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 128, 0));
# Marco
示例9: letters
public function letters()
{
$this->load->library('pdf');
$pdf = new Pdf('L', 'mm', 'LETTER', true, 'UTF-8', false);
$pdf->SetTitle('Letter to vote');
$pdf->SetHeaderMargin(30);
$pdf->SetTopMargin(20);
$pdf->setFooterMargin(10);
$pdf->SetAutoPageBreak(true, 15);
$pdf->SetAuthor('Author');
$pdf->AddPage('P', 'LEGAL');
$pdf->setY(30);
$pdf->Output('letter.pdf', 'I');
}
示例10: array
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Anibal Urbiola');
$pdf->SetTitle('Descarga de la ficha de chikungunya');
$pdf->SetSubject('Conversion a PDF');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// datos por defecto de cabecera, se pueden modificar en el archivo tcpdf_config_alt.php de libraries/config
$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->setFooterData($tc = array(0, 64, 0), $lc = array(0, 64, 128));
// datos por defecto de cabecera, se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//relación utilizada para ajustar la conversión de los píxeles
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// ---------------------------------------------------------
// establecer el modo de fuente por defecto
$pdf->setFontSubsetting(true);
// Establecer el tipo de letra
//Si tienes que imprimir carácteres ASCII estándar, puede utilizar las fuentes básicas como
// Helvetica para reducir el tamaño del archivo.
$pdf->SetFont('courier', '', 14, '', true);
// Añadir una página
// Este método tiene varias opciones, consulta la documentación para más información.
$pdf->AddPage();
示例11: generate_statistics
//.........这里部分代码省略.........
if (isset($summary) && !is_array($summary)) {
$summary = explode("+", $summary);
}
}
/**
* pdf Config
*/
if ($outputType == 'pdf') {
//require_once('classes/tcpdf/config/lang/eng.php');
global $l;
$l['w_page'] = $statlang->gT("Page", 'unescaped');
//require_once('classes/tcpdf/mypdf.php');
Yii::import('application.libraries.admin.pdf', true);
// create new PDF document
$pdf = new Pdf();
$pdf->SetFont($pdfdefaultfont, '', $pdffontsize);
$surveyInfo = getSurveyInfo($surveyid, $language);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('LimeSurvey');
$pdf->SetTitle('Statistic survey ' . $surveyid);
$pdf->SetSubject($surveyInfo['surveyls_title']);
$pdf->SetKeywords('LimeSurvey, Statistics, Survey ' . $surveyid . '');
$pdf->SetDisplayMode('fullpage', 'two');
// set header and footer fonts
$pdf->setHeaderFont(array($pdfdefaultfont, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array($pdfdefaultfont, '', PDF_FONT_SIZE_DATA));
// set default header data
$pdf->SetHeaderData("statistics.png", 10, $statlang->gT("Quick statistics", 'unescaped'), $statlang->gT("Survey") . " " . $surveyid . " '" . flattenText($surveyInfo['surveyls_title'], false, true, 'UTF-8') . "'");
// 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);
}
if ($outputType == 'xls') {
/**
* Initiate the Spreadsheet_Excel_Writer
*/
Yii::import('application.libraries.admin.pear.Spreadsheet.Excel.Xlswriter', true);
if ($pdfOutput == 'F') {
$sFileName = $tempdir . '/statistic-survey' . $surveyid . '.xls';
$workbook = new Xlswriter($sFileName);
} else {
$workbook = new Xlswriter();
}
$workbook->setVersion(8);
// Inform the module that our data will arrive as UTF-8.
// Set the temporary directory to avoid PHP error messages due to open_basedir restrictions and calls to tempnam("", ...)
$workbook->setTempDir($tempdir);
// Inform the module that our data will arrive as UTF-8.
// Set the temporary directory to avoid PHP error messages due to open_basedir restrictions and calls to tempnam("", ...)
if (!empty($tempdir)) {
$workbook->setTempDir($tempdir);
}
if ($pdfOutput != 'F') {
$workbook->send('statistic-survey' . $surveyid . '.xls');
}
// Creating the first worksheet
示例12: imprimir
function imprimir()
{
$this->load->library('Pdf');
$pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$this->load->library('zend');
//load in folder Zend
$this->zend->load('Zend/Barcode');
//generate barcode
$fichas = $this->Ficha->buscar_imprimir();
foreach ($fichas as $f) {
$res = Zend_Barcode::factory('code128', 'image', array('text' => $f['clave']), array());
$res = $res->draw();
imagepng($res, './codigos/' . $f['clave'] . '.png');
}
//$pdf->SetAuthor('Israel Parra');
// $pdf->SetTitle('Ejemplo de provincías con TCPDF');
//$pdf->SetSubject('Tutorial TCPDF');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// datos por defecto de cabecera, se pueden modificar en el archivo tcpdf_config_alt.php de libraries/config
//$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->setFooterData($tc = array(0, 64, 0), $lc = array(0, 64, 128));
// datos por defecto de cabecera, se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//relación utilizada para ajustar la conversión de los píxeles
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// ---------------------------------------------------------
// establecer el modo de fuente por defecto
$pdf->setFontSubsetting(true);
// Establecer el tipo de letra
//Si tienes que imprimir carácteres ASCII estándar, puede utilizar las fuentes básicas como
// Helvetica para reducir el tamaño del archivo.
$pdf->SetFont('freemono', '', 14, '', true);
// Añadir una página
// Este método tiene varias opciones, consulta la documentación para más información.
$pdf->AddPage();
//fijar efecto de sombra en el texto
$pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
// Establecemos el contenido para imprimir
$fichas = $this->Ficha->buscar_imprimir();
//foreach($fichas as $fila)
$i = 0;
while ($i < 1) {
$clave = $fichas[$i]['clave'];
//
//preparamos y maquetamos el contenido a crear
$html = '';
$html .= "<style type=text/css>";
$html .= "th{color: #fff; font-weight: bold; background-color: #222}";
$html .= "td{background-color: #AAC7E3; color: #fff}";
$html .= "</style>";
$html .= '<img src="./codigos/' . $clave . '.png">';
//generate barcode
//$html .= Zend_Barcode::render('code128', 'image', array('text'=>$clave), array())->render();
$style = array('border' => true, 'vpadding' => 'auto', 'hpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'module_width' => 4, 'module_height' => 3);
$pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 4, $fill = 0, $reseth = true, $align = '', $autopadding = true);
//$pdf->Ln();
//$pdf->Addpage();
$i++;
}
// ---------------------------------------------------------
// Cerrar el documento PDF y preparamos la salida
// Este método tiene varias opciones, consulte la documentación para más información.
$nombre_archivo = utf8_decode("Demandas.pdf");
$pdf->Output($nombre_archivo, 'I');
}
示例13: MatricRollNoGroupwise
public function MatricRollNoGroupwise()
{
// DebugBreak() ;
$this->load->helper('url');
//Load the library
$this->load->library('html2pdf');
$grp_cd = $this->uri->segment(3);
$sess = 1;
$class = 10;
$year = 2016;
$this->load->library('session');
$Logged_In_Array = $this->session->all_userdata();
$user = $Logged_In_Array['logged_in'];
//DebugBreak();
$this->load->library('Pdf');
$pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->setHeaderData('', 0, '', '', array(0, 0, 0), array(255, 255, 255));
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->SetTitle('Matric Roll Number Slip');
$pdf->SetHeaderMargin(1);
$pdf->SetTopMargin(1);
$pdf->setFooterMargin(1);
$pdf->SetFont('helvetica', '', 8);
$pdf->SetAutoPageBreak(TRUE, 0);
$pdf->SetAuthor('BiseGrw');
$pdf->SetMargins(4, 1, 4, true);
$Inst_Id = $user['Inst_Id'];
$this->load->model('RollNoSlip_model');
// DebugBreak();
$studeninfo = array('data' => $this->RollNoSlip_model->get10thrslipWith_Grp_CD($class, $year, $sess, $grp_cd, $Inst_Id));
$template_pdf = '';
$totalslips = count($studeninfo['data']['slip']);
$studentslip = array();
//DebugBreak();
for ($i = 0; $i < count($studeninfo['data']['info']); $i++) {
$pdf->AddPage();
$rno = $studeninfo['data']['info'][$i]['Rno'];
$temp = "{$rno}@{$class}@{$sess}@{$year}@{$Inst_Id}";
$image = $this->set_barcode($temp);
$studeninfo['data']['info'][$i]['barcode'] = $image;
for ($j = 0; $j < $totalslips; $j++) {
if ($rno == $studeninfo['data']['slip'][$j]['rno']) {
$studeninfo['data']['info'][$i]['slips'][] = $studeninfo['data']['slip'][$j];
}
}
// DebugBreak();
$html = $this->load->view('RollNoSlip/MatricRollNoCombine', $studeninfo['data']['info'][$i], true);
$pdf->writeHTML($html, true, false, true, false, '');
if ($i == 0) {
break;
}
}
$pdf->Output('pdfexample.pdf', 'I');
//$this->html2pdf->html($this->load->view('RollNoSlip/MatricRollNoCombine', $studeninfo['data'], true));
// $this->html2pdf->html($template_pdf);
/* if($this->html2pdf->create('downlaod')) {
if($class == 10)
redirect('RollNoSlip/TenthStd');
else if($class == 9)
redirect('RollNoSlip/NinthStd');
} */
}
示例14: cetak_kertas_resep
public function cetak_kertas_resep()
{
$this->load->library('Pdf');
$pdf = new Pdf('P', 'mm', 'A5', true, 'UTF-8', false);
// $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetPageOrientation('P');
$pdf->SetAuthor('Pemerintah Kota Bogor');
$pdf->SetTitle('Resep Obat');
$pdf->SetSubject('Resep Obat');
$pdf->SetKeywords('Resep Obat');
// $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->setFooterData(array(0, 64, 0), array(0, 64, 128));
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$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->setImageScale(PDF_IMAGE_SCALE_RATIO);
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
require_once dirname(__FILE__) . '/lang/eng.php';
$pdf->setLanguageArray($l);
}
$pdf->setFontSubsetting(true);
$pdf->SetFont('helvetica', '', 11, '', true);
$pdf->AddPage();
$pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
$puskesmas = $this->m_rujukan->get_puskesmas_info($this->session->userdata('kd_puskesmas'));
$kd_trans_pelayanan = $this->uri->segment(3);
$surat = $this->m_rujukan->get_data_pasien($kd_trans_pelayanan);
if ($surat['alamat'] == '') {
$surat['alamat'] = "-";
}
if ($surat['umur'] == '') {
$surat['umur'] = "-";
}
if ($surat['jenis_kelamin'] == '') {
$surat['jenis_kelamin'] = "-";
}
if ($surat['idkartu_medical'] == '') {
$surat['idkartu_medical'] = "-";
}
if ($surat['kd_bayar'] == '') {
$surat['kd_bayar'] = "-";
}
if ($surat['no_asuransi'] == '') {
$surat['no_asuransi'] = "-";
}
if ($surat['nm_dokter'] == '') {
$surat['nm_dokter'] = "_____________________";
}
$tgl = date('d-m-Y');
#echo $this->db->last_query(); exit;
$html = '<table align="center" border="0" align="left">';
$html .= '
<tr>
<td width="20%" style="text-align: center;"><img src="' . base_url() . 'assets/img/logo.png" width="80" height="80"/></td>
<td width="80%" style="text-align: center;"><h4>00/DOK IN PKM - USI/01/PKM/151/2011</h4><br><h3>PEMERINTAH PROPINSI ' . $puskesmas["nm_propinsi"] . '<br>DINAS KESEHATAN KOTA ' . $puskesmas["nm_kota"] . '</h3>
<h4>UPTD ' . $puskesmas["nm_puskesmas"] . '<br>' . $puskesmas["alamat"] . '<br>' . $puskesmas["no_telp"] . '</h4>
</td>
</tr>';
$html .= '</table>';
$html .= '<p align="left"><b>Resep Obat</b></p>';
$html .= '<table align="center" cellpadding="2" cellspacing="0" border="0" width="100%">
<tr>
<td width="20%" border="1px" style="text-align: center;">' . $surat["kd_bayar"] . '</td>
<td width="5%" style="text-align: left;"></td>
<td width="75%" style="text-align: right;">' . $puskesmas["nm_kota"] . ', ' . $tgl . '</td>
</tr>
<tr>
<td style="text-align: right;" colspan="3">No KK: ' . $surat["idkartu_medical"] . '</td>
</tr>
<tr>
<td style="text-align: right;" colspan="3">No R.M. Pasien: ' . $surat["kd_rekam_medis"] . '</td>
</tr>
<tr>
<td><p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p><p> </p><p> </p>
<p> </p></td>
</tr>
<tr>
<td style="text-align: right;" colspan="3">Pemeriksa, </td>
</tr>
<tr>
<td><p> </p>
<p> </p></td>
</tr>
<tr>
<td style="text-align: right;" colspan="3">' . $surat["nm_dokter"] . '</td>
</tr>
//.........这里部分代码省略.........
示例15: library
function make_pdf($PDF_html, $PDF_name='Ads2Trade_Document', $PDF_Title='Ads2Trade Dcoument', $PDF_Orientation="L")
{
$CI =& get_instance();
$CI->load->library('pdf'); // load library (if not already loaded - CI will handle this check for us though)
// create new PDF document
//$pdf = new TCPDF($PDF_Orientation, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf = new Pdf($PDF_Orientation, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$html = $PDF_html;
//Make sure orientation is valid i.e. either P or L
if($PDF_Orientation != 'P' && $PDF_Orientation != 'L'){
$PDF_Orientation = 'L'; //default to landscape if invalid value supplied
}
$pdf->setPageOrientation($PDF_Orientation); //custom class seemed to not be picking up orientation in constructor
if($PDF_name == '' or is_null($PDF_name)){
$PDF_name = 'Ads2Trade_Document'; //default to landscape if invalid value supplied
}
// set document information
//$pdf->SetCreator(PDF_CREATOR);
$pdf->SetCreator("Ads2Trade");
$pdf->SetAuthor('Ads2Trade');
$pdf->SetTitle('Ads2Trade Document Title Goes Here');
$pdf->SetSubject('Ads2Trade');
$pdf->SetKeywords('Ads2Trade, PDF, asset, auction, advertising');
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, $PDF_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 (optional)
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
require_once(dirname(__FILE__).'/lang/eng.php');
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('dejavusans', '', 10);
// add a page
$pdf->AddPage();
// create some HTML content
if (is_null($html) or ($html == '')) {
$html = '<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<p>ERROR: No Document Data Supplied</p>
</body>
</html>';
}
// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');
// reset pointer to the last page
$pdf->lastPage();
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output($PDF_name.'.pdf', 'I');
}