//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"); } }
$pdf->SetY($Y + 10); $pdf->Cell(0, 0, "Descuento: " . "-\$ " . number_format($totalDescuento[0], 2), 0, 0, R); $pdf->SetY($Y + 15); $pdf->Cell(0, 0, "Total: " . "\$ " . number_format($TOTAL - $totalDescuento[0], 2), 0, 0, R); } else { $pdf->SetY($Y + 10); $pdf->Cell(0, 0, "Total: " . "\$ " . number_format($TOTAL, 2), 0, 0, R); } $pdf->SetFont('Arial', '', 10); $pdf->SetXY(2, 120); $pdf->Cell(0, 0, '*** ' . $resultado . ' ' . $formula . ' ***', 0, 0, L); $pdf->SetXY(2, $Y + 10); $pdf->Cell(0, 0, 'Este documento no es deducible fiscalmente', 0, 0, L); //Launch the print dialog $pdf->AutoPrint(false); $pdf->Output(); } else { $pdf->Ln(10); //salto de linea //$pdf->Line(2,5, 199,5); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, 0, "Subtotal: " . "\$" . number_format($cargos[0] - $abonos[0], 2), 0, 0, R); $pdf->Ln(4); //salto de linea $pdf->Cell(0, 0, "Iva: " . "\$" . number_format($ivaCargos[0] - $ivaAbonos[0], 2), 0, 0, R); $pdf->Ln(4); //salto de linea $pdf->Cell(0, 0, "Total: " . "\$" . number_format($TOTAL, 2), 0, 0, R); $pdf->SetFont('Arial', '', 10); $pdf->SetX(2); $pdf->Cell(0, 0, '*** ' . $resultado . ' ' . $formula . ' ***', 0, 0, L);
$o_b = mysqli_fetch_array($opt_b); $reduce = substr($key, 0, -3); $opt_2b .= $o_b[0] . ". " . $val . "; "; } } //$opt_o = "\nOptativas de Bachillerato".$opt_2b; if ($curso == "1BACH") { $MiPDF->Cell(80, 5, $n_curso . "º DE BACH. ( " . $mod_registro . " )", 1, 0, 'C'); $MiPDF->MultiCell(88, 5, $bil . $opt, 1); $MiPDF->Ln(2); } if ($curso == "2BACH") { $MiPDF->Cell(80, 5, $n_curso . "º DE BACH. ( " . $mod_registro2b . " )", 1, 0, 'C'); $MiPDF->MultiCell(88, 5, $bil . $opt2b, 1); $MiPDF->Cell(165, 5, "MATERIAS OPTATIVAS", 0, 0, "C"); $MiPDF->Ln(5); $MiPDF->MultiCell(168, 5, $opt_2b, 1); $MiPDF->Ln(8); if (!$repetidor) { $MiPDF->Cell(165, 5, "MODALIDAD Y OPTATIVAS DE 1º BACHILLERATO", 0, 0, "C"); $MiPDF->Ln(5); $MiPDF->Cell(80, 5, "MODALIDAD " . $mod_registro . " )", 1, 0, 'C'); $MiPDF->MultiCell(88, 5, $bil . $opt, 1); $MiPDF->Ln(2); } } } } $MiPDF->AutoPrint(true); $MiPDF->Output();