本文整理匯總了PHP中PDF_AutoPrint::Open方法的典型用法代碼示例。如果您正苦於以下問題:PHP PDF_AutoPrint::Open方法的具體用法?PHP PDF_AutoPrint::Open怎麽用?PHP PDF_AutoPrint::Open使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PDF_AutoPrint
的用法示例。
在下文中一共展示了PDF_AutoPrint::Open方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: AutoPrintToPrinter
{
//Launch the print dialog or start printing immediately on the standard printer
$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();
$pdf->Open();
$pdf->AddPage();
$pdf->SetFont('Arial','',20);
$pdf->Text(90, 50, 'Print me!');
//Launch the print dialog
$pdf->AutoPrint(true);
$pdf->Output();
?>