本文整理汇总了PHP中mPDF::AddPage方法的典型用法代码示例。如果您正苦于以下问题:PHP mPDF::AddPage方法的具体用法?PHP mPDF::AddPage怎么用?PHP mPDF::AddPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mPDF
的用法示例。
在下文中一共展示了mPDF::AddPage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadMpdf
function loadMpdf($html, $output = null, $param = 1)
{
// echo "masuk";
// echo $output;
// exit;
global $CONFIG;
$pdf_ext = '.pdf';
$mpdfEngine = '../' . LIBS . 'mpdf/mpdf' . $CONFIG[$this->configkey]['php_ext'];
if (is_file($mpdfEngine)) {
require_once $mpdfEngine;
if ($param == 1) {
$mpdf = new mPDF('c', 'A4', '', '', 15, 15, 16, 16, 9, 9, 'L');
$mpdf->SetDisplayMode('fullpage');
} elseif ($param == 2) {
$mpdf = new mPDF('', '', '', '', 15, 15, 16, 16, 9, 9, 'P');
$mpdf->AddPage('L', '', '', '', '', 15, 15, 16, 16, 9, 9);
}
// $mpdf=new mPDF('c','A4','','',32,25,27,25,16,13);
// $mpdf->setFooter('{PAGENO}') ;
$mpdf->WriteHTML($html);
$mpdf->Output($output . '-' . date(ymdhis) . $pdf_ext, 'D');
logFile('load excel success');
} else {
logFile('excel lib not found');
}
exit;
}
示例2: mPDF
include "../mpdf.php";
$mpdf = new mPDF('win-1252', 'A4', '', '', 42, 15, 57, 57, 20, 17);
$mpdf->useOnlyCoreFonts = true;
$mpdf->displayDefaultOrientation = true;
$mpdf->forcePortraitHeaders = true;
$mpdf->forcePortraitMargins = true;
$mpdf->SetDisplayMode('fullpage', 'two');
$mpdf->mirrorMargins = 1;
$stylesheet = file_get_contents('mpdfstyletables.css');
$mpdf->WriteHTML($stylesheet, 1);
$mpdf->SetHTMLHeader($header);
$mpdf->SetHTMLHeader($headerE, 'E');
$mpdf->SetHTMLFooter($footer);
$mpdf->SetHTMLFooter($footerE, 'E');
$mpdf->WriteHTML($html);
$mpdf->AddPage('L');
$mpdf->WriteHTML($htmlL);
$mpdf->WriteHTML($htmlL);
// Columns
$mpdf->AddPage('L');
$mpdf->SetColumns(3, 'J');
$mpdf->WriteHTML($loremH);
$mpdf->SetColumns(0);
$mpdf->WriteHTML('<hr />');
$mpdf->SetColumns(2, 'J');
$mpdf->WriteHTML($loremH);
$mpdf->WriteHTML('<hr />');
$mpdf->SetColumns(0);
$mpdf->AddPage('L');
$mpdf->WriteHTML($htmlL);
$mpdf->WriteHTML($htmlL);
示例3: merge
/**
* @param string $dest
* @param string[] $files
* @return bool true, falls min ein Quelldokument verwendbar war
*/
public static function merge($dest, $files)
{
Logging::info('Erzeuge ' . $dest);
//$dest = Files::validateFilename($dest);
$pdf = new \mPDF('de-DE', 'A4');
$pdf->SetImportUse();
$page = 0;
foreach ($files as $curFile) {
Logging::info('Eingangsdatei ' . $curFile);
if ($curFile == '') {
continue;
}
$pagecount = $pdf->SetSourceFile($curFile);
if ($page != 0) {
$pdf->AddPage();
}
for ($i = 1; $i <= $pagecount; $i++) {
$import_page = $pdf->ImportPage($i);
$pdf->UseTemplate($import_page);
if ($i < $pagecount) {
$pdf->AddPage();
}
}
$page++;
}
$pdf->Output($dest, 'F');
return $page > 0;
}
示例4: _gen_pdf
public function _gen_pdf($html, $paper, $layoutpage)
{
ob_end_clean();
$mpdf = new mPDF('utf-8', $paper);
ini_set('memory_limit', '100M');
$mpdf->debug = true;
$mpdf->SetDisplayMode('fullpage');
$mpdf->AddPage($layoutpage);
$mpdf->WriteHTML($html);
$mpdf->Output();
}
示例5: mergePdf
/**
* merge another pdf to current
* @param type $anotherPdfPath
* @return \Kohana_MPDF
*/
public function mergePdf($anotherPdfPath)
{
$this->checkMpdfInit();
$pagecount = $this->setSourceFile($anotherPdfPath);
for ($i = 1; $i <= $pagecount; $i++) {
$this->mpdf->AddPage();
$tplId = $this->mpdf->ImportPage($i);
$this->mpdf->UseTemplate($tplId);
$this->mpdf->WriteHTML();
}
return $this;
}
示例6: mPDF
// exit;
//set gambar untuk laporan
$gambar = $FILE_GAMBAR_KABUPATEN;
$html=$REPORT->retrieve_html_cetak_label($result_query,$gambar,$tahun);
/*$count = count($html);
for ($i = 0; $i < $count; $i++) {
echo $html[$i];
}
exit;*/
$REPORT->show_status_download();
$mpdf=new mPDF('','','','',8,8,5,5,10,10,'P');
$mpdf->AddPage('P','','','','',8,8,5,5,10,10);
// $mpdf->setFooter('{PAGENO}') ;
$mpdf->progbar_heading = '';
$mpdf->StartProgressBarOutput(2);
$mpdf->useGraphs = true;
$mpdf->list_number_suffix = ')';
$mpdf->hyphenate = true;
$count = count($html);
for ($i = 0; $i < $count; $i++) {
if($i==0)
$mpdf->WriteHTML($html[$i]);
else
{
$mpdf->AddPage('P','','','','',15,15,16,16,9,9);
$mpdf->WriteHTML($html[$i]);
示例7: mPDF
<?php
$mpdf = new mPDF('', '', 0, '', 10, 10, 16, 16, 9, 26, 'L');
$stylesheet = file_get_contents("../web/css/relatorios-css/relatorio.css");
$mpdf->WriteHTML($stylesheet, 1);
$mpdf->SetTitle($model->titulo);
// Set a simple Footer including the page number
$mpdf->setFooter('<div>Relatório emitido SiGeCentro <br> {PAGENO}/{nb}</div>');
// Turn off (suppress) page numbering from the start of the document
$mpdf->AddPage('', '', '', '', 'on');
$header = "<div id='cabecalho' >\n \t\t\t<div id='cabecalho-imagem'>\n \t\t\t\t<img id='cabecalho-img' src='" . $model->getImagemLogo() . "'/>\n \t\t\t</div>\t\n \t\t\t<div id='cabecalho-titulo' >\n \t\t\t\t" . $model->titulo . "\n \t\t\t</div>\n \t\t\t<div id='cabecalho-emissao'>\n <b>SiGeCentro</b> \n <br/>\n \t\t\t\t<b>Emitido em: " . $model->getDataHora() . "</b>\n\n \t\t\t</div>\t\n \t\t</div>\n <div class='clear'> </div>";
$mpdf->SetHTMLHeader($header, null, true);
$html = "<div id='corpo'>";
for ($i = 1; $i < 400; $i++) {
$html .= "linha número {$i} | " . $i % 40 . "<br>";
if ($i % 40 == 0) {
// realiza quebra de página e adiciona uma nova
$html .= "</div><pagebreak /><div id='corpo'>";
}
}
$html .= "</div>";
$mpdf->WriteHTML($html);
$mpdf->Output();
exit;
示例8: index
public function index()
{
$final_html = "";
$css = "<style type='text/css'>\n\t\ttd{\n\t\t\tborder:1px solid black; \n\t\t}\n\t\t.no_border{\n\t\t\tborder: none;\n\t\t} \n\t\t.regionals td{\n\t\t\tmin-width:110px;\n\t\t}\n\t\tth, .title{\n\t\t\tbackground:#DDD;\n\t\t\tborder:none;\n\t\t\tpadding:0;\n\t\t\tmargin:0;\n\t\t}\n\t\t\n\t\t</style>";
$final_html .= $css;
$html_title = "<img src='Images/coat_of_arms.png' style='position:absolute; width:160px; top:0px; right:0px; margin-bottom:-100px;margin-right:-100px;'></img>";
$html_title .= "<h2 style='text-align:center; text-decoration:underline;'>Republic of Kenya</h2>";
$html_title .= "<h3 style='text-align:center; text-decoration:underline;'>Ministry of Public Health and Sanitation</h3>";
$html_title .= "<h1 style='text-align:center; text-decoration:underline;'>MONTHLY VACCINE STOCK MANAGEMENT REPORT</h1>";
//echo "$html_title";
$final_html .= $html_title;
$final_html .= $this->create_national_report();
$this->load->library('mpdf');
$mpdf = new mPDF('', 'A4-L', 0, '', 15, 15, 16, 16, 9, 9, '');
$mpdf->SetTitle('MONTHLY VACCINE STOCK MANAGEMENT REPORT');
$mpdf->WriteHTML($final_html);
$regions = Regions::getAllRegions();
foreach ($regions as $region) {
$regional_report = $this->create_regional_reports($region);
$mpdf->AddPage();
$mpdf->WriteHTML($regional_report);
//
}
//echo $final_html
$mpdf->Output('Summaries/Monthly_Summary.pdf', 'F');
$this->email_reports();
}
示例9: gerar
/**
* @param Carne $carne
* @return \mPDF
*/
public function gerar(Carne $carne)
{
$mpdf = new \mPDF("", 'A4');
$mpdf->DeflMargin = 3;
$mpdf->DefrMargin = 3;
$mpdf->SetTopMargin(3);
$mpdf->AddPage();
/**
* @var $boleto Boleto
*/
foreach ($carne->getBoletos() as $boleto) {
$codigoBarras = $this->geradorCodigoBarras->getBarcode($boleto->getLinha(), BarcodeGeneratorSVG::TYPE_INTERLEAVED_2_5, 1, 40);
$html = $this->twig->render($carne->getBanco()->getLayoutCarne(), ['boleto' => $boleto, 'codigoBarras' => base64_encode($codigoBarras), 'logoBanco' => base64_encode(file_get_contents(GeradorCarne::getDirImages() . 'logocaixa.jpg'))]);
$mpdf->WriteHTML($html);
$mpdf->Ln(2);
}
return $mpdf;
}
示例10: generateInvoice
public function generateInvoice($id)
{
$order = $this->getOrder($id);
$CompanySettings = $this->em->getRepository('MeVisaERPBundle:CompanySettings')->find(1);
$invoice = new \MeVisa\ERPBundle\Entity\Invoices();
$invoice->setCreatedAt(new \DateTime());
$order->addInvoice($invoice);
$this->em->persist($invoice);
$this->em->flush();
$products = $order->getOrderProducts();
$productsLine = array();
foreach ($products as $product) {
$productsLine[] = $product->getProduct()->getName();
}
$productsLine = implode(',', $productsLine);
$myProjectDirectory = __DIR__ . '/../../../../';
$invoiceName = 'mevisa-invoice-' . $order->getNumber() . '-' . $invoice->getId() . '.pdf';
$invoicePath = $myProjectDirectory . 'web/invoices/';
$pdfInvoiceHTML = $this->templating->render('MeVisaERPBundle:Orders:pdfinvoice.html.twig', array('order' => $order, 'invoice' => $invoice, 'companySettings' => $CompanySettings));
$pdfAgreementHTML = $this->templating->render('MeVisaERPBundle:Orders:pdfagreement.html.twig', array('order' => $order, 'productsLine' => $productsLine, 'invoice' => $invoice, 'companySettings' => $CompanySettings));
$pdfWaiverHTML = $this->templating->render('MeVisaERPBundle:Orders:pdfwaiver.html.twig', array('order' => $order, 'invoice' => $invoice, 'companySettings' => $CompanySettings));
$mpdf = new \mPDF("ru-RU", "A4");
$mpdf->SetTitle("MeVisa Invoice " . $order->getNumber() . '-' . $invoice->getId());
$mpdf->SetAuthor($CompanySettings->getName());
$mpdf->WriteHTML($pdfInvoiceHTML);
$mpdf->AddPage();
$mpdf->WriteHTML($pdfAgreementHTML);
$mpdf->AddPage();
$mpdf->WriteHTML($pdfWaiverHTML);
$mpdf->Output($invoicePath . $invoiceName, 'F');
$this->em->flush();
}
示例11: cetak_surat
public function cetak_surat()
{
setlocale(LC_TIME, 'id_ID');
$this->load->helper('date');
$timenow = unix_to_human(now('Asia/Jakarta'), TRUE, 'us');
$time = date("Ymd-Hi", strtotime($timenow));
$this->load->model('m_mpdf');
$iduser = $this->input->post('iduser', TRUE);
$kategori = $this->input->post('kategori', TRUE);
$noaplikasi = $this->input->post('noaplikasi', TRUE);
if ($kategori == "menlu") {
$result = $this->m_mpdf->get_pdln_user($iduser);
$nip = $result['nip_pemohon'];
$html = $this->load->view('mpdf_template/surat_menlu', $result, true);
} else {
$result['query'] = $this->m_mpdf->get_pdln_user2($iduser, $noaplikasi);
$nip = $result['query'][0]['nip_pemohon'];
$html1 = $this->load->view('mpdf_template/surat_setneg_2', $result, true);
$html2 = $this->load->view('mpdf_template/surat_setneg_2_page2', $result, true);
}
$filename = $time . '-' . $menset . '-' . $nip;
$this->load->library('l_mpdf');
$mpdf = $this->l_mpdf->load();
$mpdf = new mPDF('', 'A4', '', '', 30, 20, 20, 25);
if ($kategori == "menlu") {
$mpdf->WriteHTML($html);
} else {
$mpdf->WriteHTML($html1);
$mpdf->AddPage();
$mpdf->WriteHTML($html2);
}
if ($filename != "") {
$mpdf->Output(FCPATH . '../files/' . $kategori . '.pdf', 'F');
}
$mpdf->Output();
}
示例12: count
$gambar = $FILE_GAMBAR_KABUPATEN;
//retrieve html
$html=$REPORT->retrieve_html_mutasi_transfer_antar_skpd($result_query, $gambar);
//print html
$count = count($html);
for ($i = 0; $i < $count; $i++) {
//echo $html[$i];
}
//cetak reporting
$REPORT->show_status_download_kib();
$mpdf=new mPDF('','','','',15,15,16,16,9,9,'L');
$mpdf->debug=true;
$mpdf->AddPage('L','','','','',15,15,16,16,9,9);
$mpdf->setFooter('{PAGENO}') ;
$mpdf->progbar_heading = '';
$mpdf->StartProgressBarOutput(2);
$mpdf->useGraphs = true;
$mpdf->list_number_suffix = ')';
$mpdf->hyphenate = true;
$count = count($html);
for ($i = 0; $i <= $count; $i++) {
if($i==0)
$mpdf->WriteHTML($html[$i]);
else
{
$mpdf->AddPage('L','','','','',15,15,16,16,9,9);
$mpdf->WriteHTML($html[$i]);
示例13: index
function index(){
$this->load->library('mpdf/mpdf');// Load the mpdf library
//calculate previous dates
if(date('m')==1)
{
$previous_month=12;
$year=date('Y')-1;
}
else
{
$previous_month=date('m')-1;
$year=date('Y');
}
$fromdate=$year.'-'.$previous_month.'-01';
$num_of_days=cal_days_in_month(CAL_GREGORIAN, $previous_month,$year);
$todate=$year.'-'.$previous_month.'-'.$num_of_days;
$CHAI_team=array('mwangikevinn@gmail.com','brianhawi92@gmail.com');
//table styling
$css_styling = '<style>table.data-table {border: 1px solid #DDD;margin: 10px auto;border-spacing: 0px;}
table.data-table th {border: none;color: #036;text-align: center;background-color: #F5F5F5;border: 1px solid #DDD;border-top: none;max-width: 450px;}
table.data-table td, table th {padding: 4px;}
table.data-table td {border: none;border-left: 1px solid #DDD;border-right: 1px solid #DDD;height: 30px;margin: 0px;border-bottom: 1px solid #DDD;}
.col5{background:#D8D8D8;}</style>';
$header='<h2>FACILITY CONSUMPTION DATA REPORT & REQUEST(F-CDRR) FOR ART LABORATORY MONITORING REAGENTS</h2>';
$fromdate='2015-02-01';
$todate='2015-02-28';
$fcdrr_list="";
$fcdrr_list=$this->fcdrr_model->get_fcdrr_list($fromdate,$todate);
foreach($fcdrr_list->result_array() as $fcdrr_result)
{
$final_pdf_data=$this->fcdrr_model->get_fcdrr_content($fcdrr_result);
if($final_pdf_data)
{
$pdf_document=$css_styling.$header.$final_pdf_data;
$mpdf=new mPDF();
$mpdf->AddPage('', 'A4-L', 0, '', 15, 15, 16, 16, 9, 9, '');
$mpdf->SetDisplayMode('fullpage');
$mpdf->simpleTables = true;
$mpdf->SetDisplayMode('fullpage');
$mpdf->simpleTables = true;
$mpdf->list_indent_first_level = 0; // 1 or 0 - whether to indent the first level of a list
$mpdf->list_indent_first_level = 0; // 1 or 0 - whether to indent the first level of a list
//Generate pdf using mpdf
$mpdf ->SetWatermarkText("Nascop",-5);
$mpdf ->watermark_font = "sans-serif";
$mpdf ->showWatermarkText = true;
$mpdf ->watermark_size="0.5";
$filename=str_replace('/','-', $fcdrr_result['name']);
$mpdf->WriteHTML($pdf_document);
try
{
$filename=$this->config->item('server_root').'pdf_documents/fcdrr_individual_monthly/'.$filename.'.pdf';
$mpdf->Output($filename,'F');
}
catch(exception $e)
{
$e->getMessage();
}
/* Prepare email configurations */
//$month_name=$this->GetMonthName($previous_month);
// $this->email->from('cd4system@gmail.com', 'CD4 Notification');
// $this->email->subject('CD4 FCDRR Commodity Reports for '.$month_name.' - '.$year.' '); //subject
// $message="Good Day<br />Find attached the FCDRR Report For ART Lab Monitoring Reagents for ".$fcdrr_result['name']." for the month of ".$month_name.", ".$year.".<br />
// Regards.
// <br /><br />CD4 Support Team";
//$this->email->message($message);// the message
// $county_coordinator_email=$this->fcdrr_model->get_county_email($fcdrr_result['sub_county_id']);
// foreach($county_coordinator_email as $cemail)
// {
// $county_receipients[]=$cemail;
// }
// $partner_email=$this->fcdrr_model->get_partner_email($fcdrr_result['partner_id']);
//.........这里部分代码省略.........
示例14: createPdf
/**
* Create a PDF and export to defined path
* @param $dir str directory of the source file to convert
* @param $src str filename of the source file to convert
* @param $path str path to export the resultant PDF to
* @param $chapters array chapters to convert into a single PDF
* @param $journalId int Id of the journal(imprint)
* @param $args array arguments for the conversion (e.g. Description, cover image, etc)
* @param $coverPath str path to export the front cover artwork to
*/
function createPdf($dir = null, $src, $path, $chapters = array(), $journalId, $args = array(), $coverPath)
{
$mpdf = new mPDF('utf-8');
$mpdf->useOddEven = 1;
$htmlEncode = array('title', 'author');
foreach ($htmlEncode as $encode) {
$args[$encode] = htmlentities($args[$encode], ENT_QUOTES, "UTF-8");
}
isset($args['title']) ? $mpdf->SetTitle($args['title']) : $mpdf->SetTitle("No Title");
isset($args['description']) ? $mpdf->SetSubject($args['description']) : $mpdf->SetSubject("No description");
isset($args['author']) ? $mpdf->SetCreator($args['author']) : $mpdf->SetCreator("No author");
$CBPPlatformDao =& DAORegistry::getDAO('CBPPlatformDAO');
$imprintType = $CBPPlatformDao->getImprintType($journalId);
$stylesheet = $CBPPlatformDao->getImprintStylesheet($journalId);
$stylesheetContents = file_get_contents($this->stylesheetDir . "{$stylesheet}.css");
$mpdf->WriteHTML($stylesheetContents, 1);
$mpdf->WriteHTML($this->contentStart . '
<htmlpagefooter name="myFooter1" style="display:none">
<table width="100%" style="vertical-align: bottom; font-family: serif; font-size: 8pt;
color: #000000; font-weight: bold; font-style: italic;"><tr>
<td width="33%" style="text-align: right; ">{PAGENO}</td>
</tr></table>
</htmlpagefooter>
<htmlpagefooter name="myFooter2" style="display:none">
<table width="100%" style="vertical-align: bottom; font-family: serif; font-size: 8pt;
color: #000000; font-weight: bold; font-style: italic;"><tr>
<td width="33%"><span style="font-weight: bold; font-style: italic;">{PAGENO}</span></td>
</tr></table>
</htmlpagefooter>');
$imagesize = getimagesize($args['cover']);
if (substr($imagesize[1] / $imagesize[0], 0, strpos($imagesize[1] / $imagesize[0], '.') + 1 + 2) == 1.41 || substr($imagesize[1] / $imagesize[0], 0, strpos($imagesize[1] / $imagesize[0], '.') + 1 + 2) == 1.53) {
$pdfContent .= '<div style="position: absolute; left:0; right: 0; top: 0; bottom: 0;"><img src="' . $args['cover'] . '" id="cover" /></div>';
} else {
$pdfContent .= "<div style='margin: 0 auto; width: 80%; text-align: center;'>";
if (isset($args['title'])) {
$pdfContent .= "<h1>" . $args['title'] . "</h1>";
}
if (isset($args['cover'])) {
$pdfContent .= "<img src=\"" . $args['cover'] . "\" >";
} else {
$pdfContent .= "<br/>";
}
if (isset($args['author'])) {
$pdfContent .= "<h2>" . $args['author'] . "</h2>";
}
$pdfContent .= "</div>";
}
$mpdf->WriteHTML($pdfContent);
$mpdf->AddPage('', '', '', '', 'Off');
$copyrightStatement = $CBPPlatformDao->getJournalCopyrightStatement($journalId);
if (!empty($copyrightStatement)) {
$copyrightStatement = reset($copyrightStatement);
$mpdf->AddPage('', '', '', '', 'Off');
$innerPageConent = "<div style='width: 90%; text-align: center; margin: 0 auto;'><p>" . $copyrightStatement . "</p></div>";
$mpdf->WriteHTML($innerPageConent);
}
if (!empty($chapters)) {
$mpdf->TOCpagebreakByArray(array('TOCusePaging' => true, 'TOCuseLinking' => true, 'toc_preHTML' => '<h1>Table of Contents</h1>', 'toc_postHTML' => '', 'resetpagenum' => 1, 'suppress' => 'true'));
$chapterCount = 0;
$authorBiographies = 0;
foreach ($chapters as $chapter) {
if (!isset($chapter['type']) && $chapter['type'] != "supp") {
$chapterCount++;
} else {
if ($chapter['desc'] == "Author Biography") {
$authorBiographies++;
}
$suppChapters = true;
}
}
for ($i = 0; $i < count($chapters); $i++) {
$htmlEncode = array('name', 'author');
foreach ($htmlEncode as $encode) {
$chapters[$i][$encode] = htmlentities($chapters[$i][$encode], ENT_QUOTES, "UTF-8");
}
$document = new TransformDoc();
$document->setStrFile($chapters[$i]['src'], $chapters[$i]['dir']);
$document->generateXHTML();
//problem, here
$document->validatorXHTML();
if ($chapterCount == 1) {
$contentPreg = $this->stripTagsAddChapters($document->getStrXHTML());
$contentPreg = ltrim($contentPreg);
if (substr($contentPreg, 0, 13) == "<pagebreak />") {
$contentPreg = substr_replace($contentPreg, '', 0, 13);
}
$mpdf->addPage('', '', '', '', 'On');
$mpdf->PageNumSubstitutions[] = array('from' => $mpdf->page + 1, 'reset' => 1, 'type' => '1', 'suppress' => 'off');
$mpdf->WriteHTML("<div class='content'>", 2);
$mpdf->WriteHTML($contentPreg, 2);
//.........这里部分代码省略.........
示例15: mPDF
function create_pdf($load_id, $bol_number, $pages_number, $doc_type, $json = null)
{
$this->load->model('shipment_model');
if (!$load_id) {
$load_id = $this->input->post('load_id');
}
if (!$bol_number) {
$bol_number = $this->input->post('bol_number');
}
if (!$pages_number) {
$pages_number = $this->input->post('pages_number');
}
if (!$doc_type) {
$doc_type = $this->input->post('doc_type');
}
$shipments = $this->shipment_model->get(['bol_number' => $bol_number]);
$shipment = $shipments[0];
if ($doc_type == 'sp') {
$pages_number = $shipment['pickup_doc_pages'];
}
if ($doc_type == 'cs') {
$pages_number = $shipment['drop_doc_pages'];
}
include '../testserver/MPDF53/mpdf.php';
$mpdf = new mPDF();
for ($i = 1; $i <= $pages_number; $i++) {
$mpdf->WriteHTML('');
if (file_exists(CONT_FILE_PATH . $load_id . '_bol_' . $bol_number . '_' . $doc_type . '-' . $i . '.jpg')) {
$mpdf->Image(CONT_FILE_PATH . $load_id . '_bol_' . $bol_number . '_' . $doc_type . '-' . $i . '.jpg', 0, 0, 210, 297, 'jpg', '', true, false);
if ($i < $pages_number) {
$mpdf->AddPage();
}
}
}
$url = CONT_FILE_PATH . $load_id . '_bol_' . $bol_number . '_' . $doc_type . '.pdf';
$url_view = VIEW_FILE_PATH . $load_id . '_bol_' . $bol_number . '_' . $doc_type . '.pdf';
$mpdf->Output($url, 'F');
if ($json) {
$this->output->set_output(json_encode(['status' => 1, 'url' => $url_view]));
}
}