AuthUser(); require_once(DOC_ROOT.'/tcpdf/config/lang/eng.php'); require_once(DOC_ROOT.'/tcpdf/tcpdf.php'); $envioId = intval($_GET['id']); $envio->setEnvioId($envioId); $info = $envio->Info(); $sucursal->setSucursalId($info['sucOrigen']); $infO = $sucursal->Info(); $info['sucOrigen'] = urldecode($sucursal->GetNameById()); $info['nomGteO'] = $sucursal->GetNomGerente(); $info['telO'] = $infO['telefono']; $dirO = $infO['calle'].', No. Ext. '.$infO['noExt'].', No. Int. '.$infO['noInt'].', '.$infO['colonia']; $dirO .= ', '.$infO['municipio'].', '.$infO['ciudad'].', '.$infO['estado'].', C.P. '.$infO['cp']; $info['dirO'] = utf8_encode($dirO); $sucursal->setSucursalId($info['sucursalId']); $infD = $sucursal->Info(); $info['nomSuc'] = urldecode($sucursal->GetNameById()); $info['nomGteD'] = $sucursal->GetNomGerente(); $info['telD'] = $infD['telefono']; $dirD = $infD['calle'].', No. Ext. '.$infD['noExt'].', No. Int. '.$infD['noInt'].', '.$infD['colonia']; $dirD .= ', '.$infD['municipio'].', '.$infD['ciudad'].', '.$infD['estado'].', C.P. '.$infD['cp']; $info['dirD'] = utf8_encode($dirD); $total = $envio->GetValorTotal(); $info['total'] = number_format($total,2); // 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(''); $pdf->SetTitle(''); $pdf->SetSubject(''); $pdf->SetKeywords(''); // set default header data $pdf->SetHeaderData('', '', 'Talones de Embarque', ''); // 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); // --------------------------------------------------------- // add a page $pdf->AddPage(); $pdf->SetFont('helvetica', '', 9); // ----------------------------------------------------------------------------- for($k=1; $k<=$info['noCajas']; $k++){ $tbl .= '
 Novomoda
 Remitente  '.$info['sucOrigen'].'
 Gte. '.$info['nomGteO'].'
 Dir. '.$info['dirO'].'
 Tel. '.$info['telO'].'
 No. de Envio: '.$envioId.'
 Destinatario  '.$info['nomSuc'].'
 Gte. '.$info['nomGteD'].'
 Dir. '.$info['dirD'].'
 Tel. '.$info['telD'].'
 Conteo de Cajas  Caja '.$k.' de '.$info['noCajas'].'
 Contenido  Ropa en General
 Valor  '.$info['total'].'


'; } $pdf->writeHTML($tbl, true, false, false, false, ''); // ----------------------------------------------------------------------------- //Close and output PDF document $pdf->Output('example_048.pdf', 'I'); ?>