1 頁 (共 1 頁)

HP Laserjet 5100 批次plt圖檔列印

發表於 : 2004-05-02 17:59:56
yehlu
叫用的批次檔NpA4.bat
========================================
@echo off
echo 列印 PLT 檔案,....

REM 檢查網路連線
if not exist \\PRO-1\DATA\CCL600\CCL600.END goto NO_LINK

REM 建立印表機網路連線
Net Use LPT1: \\PRO-1\CCL600>nul

REM 將圖檔轉90度
D:\CCL600\POuts.EXE %1 D:\CCL600

REM 叫用PHP執行列印
D:\CCL600\PHP D:\CCL600\PHPPLOT.PHP

REM 刪除暫存檔
del D:\CCL600\*.PB! /q

REM 取消印表機網路連線
net use LPT1: /Delete>nul

goto EXIT

:NO_LINK
echo 網路未正確連結.

goto EXIT

:EXIT
========================================

使用 PHP 做為 shell script
PHPPLOT.PHP
程式內容如下
========================================
<?php
$d = dir("./");
while (false !== ($entry = $d->read())) {
if(substr($entry,-3)=="PB!"){
$counter++;
echo $counter.",".$entry."\n";
system("print /d:LPT1 CCL600.a4>nul");//送出列印格式設定
system("print /d:lpt1 ".$entry);//列出圖檔
}
}
system("print /d:lpt1 eject");//送出跳頁指令
$d->close();
?>
========================================