$db->update($sql, $data); $sql = "SELECT `hn`,`idcard`,`yot`,`name`,`surname`,`ptright`,`dbirth`,`no_card` FROM `opcard` WHERE `hn` LIKE :hn_patient "; $data = array(':hn_patient' => $cHn); $db->select($sql, $data); $item = $db->get_item(); $pdf = new PDF_AutoPrint("P",'mm', "A4"); $pdf->SetThaiFont(); // à«çµ¿Í¹µì $pdf->SetAutoPageBreak(false, 0); $pdf->SetMargins(0, 0); $pdf->SetTopMargin(2); $pdf->AddPage(); $pdf->SetFont('THSarabun'); // àÃÕ¡ãªé§Ò¹¿Í¹µì·ÕèàµÃÕÂÁäÇé $pdf->SetFontSize(17); $pdf->SetXY(185, 7); $pdf->Cell(10, 6, $item['no_card'],0,1); $pdf->SetXY(45, 19); $pdf->Cell(40, 6, $item['hn'],0,1); $pdf->SetXY(110, 19); $pdf->Cell(100, 6, $item['yot'].' '.$item['name'].' '.$item['surname'],0,1); $pdf->SetXY(45, 27);
{ //Print on a shared printer (requires at least Acrobat 6) $script = "var pp = getPrintParams();"; if ($dialog) { $script .= "pp.interactive = pp.constants.interactionLevel.full;"; } else { $script .= "pp.interactive = pp.constants.interactionLevel.automatic;"; } $script .= "pp.printerName = '\\\\\\\\" . $server . "\\\\" . $printer . "';"; $script .= "print(pp);"; $this->IncludeJS($script); } } $pdf = new PDF_AutoPrint('P', 'mm', 'A4'); $pdf->AliasNbPages(); $pdf->SetTopMargin(10); $pdf->SetLeftMargin(10); $pdf->SetRightMargin(10); $pdf->AddPage(); $pdf->SetWidths(array(20, 20, 20, 20, 110)); $pdf->SetAligns(array('C', 'R', 'R', 'R', 'L')); srand(microtime() * 1000000); $pdf->Table(); $filename = "Laporan Stok " . $GLOBALS['ItemName'] . " " . $GLOBALS['date'] . ".pdf"; //$pdf->AutoPrint(true); if ($_GET['PrintType'] == "1") { $pdf->Output($filename, "D"); } else { $pdf->AutoPrint(true); $pdf->Output($filename, "I"); }
} else { $script .= "pp.interactive = pp.constants.interactionLevel.automatic;"; } $script .= "pp.printerName = '\\\\\\\\" . $server . "\\\\" . $printer . "';"; $script .= "print(pp);"; $this->IncludeJS($script); } } $pdf = new PDF_AutoPrint('P', 'cm', 'custom', 431.3, 263.622); //$pdf->FPDF('P','mm','A4'); //$pdf=new FPDF('P','cm','custom',362.835,263.622); //ingreso medida puntos //$pdf->Open(); $pdf->AliasNbPages(); $pdf->SetLeftMargin(1.8); $pdf->PageNo(); $pdf->SetTopMargin(1.7); $pdf->SetAutoPageBreak(0.5); $pdf->AddPage(); $pdf->SetFont('arial', '', 8); $venta->ventas_ver($_REQUEST['venta']); $nro_documento = $venta->ven_nrodoc; $cliente_nombre = $venta->cli_razonsocial; $cliente_direccion = $venta->cli_direccion; $cliente_ruc = $venta->cli_ruc; $e_fecha = $venta->_util->obtiene_fecha($venta->ven_fecha); $fecha = explode("/", $e_fecha); //si fecha esta en formato dia-mes-año $dia = $fecha[0]; $mes = $venta->_util->ver_nombre_mes($fecha[1]); $mes_numero = $fecha[1]; $anio = substr($fecha[2], 2);
$param = $dialog ? 'true' : 'false'; $script = "print({$param});"; $this->IncludeJS($script); } function AutoPrintToPrinter($server, $printer, $dialog = false) { //Print on a shared printer (requires at least Acrobat 6) $script = "var pp = getPrintParams();"; if ($dialog) { $script .= "pp.interactive = pp.constants.interactionLevel.full;"; } else { $script .= "pp.interactive = pp.constants.interactionLevel.automatic;"; } $script .= "pp.printerName = '\\\\\\\\" . $server . "\\\\" . $printer . "';"; $script .= "print(pp);"; $this->IncludeJS($script); } } $pdf = new PDF_AutoPrint('P', 'cm', 'A5'); $pdf->AliasNbPages(); $pdf->SetTopMargin(0.5); $pdf->SetLeftMargin(1); $pdf->SetRightMargin(1); $pdf->AddPage(); $pdf->Table(); $filename = "Invoice.pdf"; $pdf->AutoPrint(true); $pdf->Output($filename, "I"); //$printcmd = "java -classpath C:/xampp/htdocs/Projects/KlinikGigi/Source/assets/lib/pdfbox-app-2.0.2.jar org.apache.pdfbox.PrintPDF -silentPrint -printerName 'EPSON ME 340 Series' C:/xampp/htdocs/Projects/KlinikGigi/Source/Transaction/Payment/Print.php"; //exec($printcmd); }
$script .= "pp.interactive = pp.constants.interactionLevel.full;"; } else { $script .= "pp.interactive = pp.constants.interactionLevel.automatic;"; } $script .= "pp.printerName = '\\\\\\\\" . $server . "\\\\" . $printer . "';"; $script .= "print(pp);"; $this->IncludeJS($script); } } $pdf = new PDF_AutoPrint('P', 'cm', 'custom', 714.0, 394.016); //ingreso medida puntos //$pdf->Open(); $pdf->AliasNbPages(); $pdf->SetLeftMargin(0.3); $pdf->PageNo(); $pdf->SetTopMargin(2.5); $pdf->SetAutoPageBreak(0.9); $pdf->AddPage(); $pdf->SetFont('arial', '', 9); $venta->ventas_ver($_REQUEST['venta']); $nro_documento = $venta->ven_nrodoc; $cliente_nombre = $venta->cli_razonsocial; $cliente_direccion = $venta->cli_direccion; $cliente_ruc = $venta->cli_ruc; $e_fecha = $venta->_util->obtiene_fecha($venta->ven_fecha); $fecha = explode("/", $e_fecha); //si fecha esta en formato dia-mes-año $dia = $fecha[0]; $mes = $venta->_util->ver_nombre_mes($fecha[1]); $mes_numero = $fecha[1]; $anio = substr($fecha[2], 2);