<?php
/*$output = shell_exec('lp aa.prn');
echo "<pre>$output</pre>";
print "AAAA";*/

//$tmpdir = sys_get_temp_dir();   # ambil direktori temporary untuk simpan file.
$file =  'aaa.txt';  # nama file temporary yang akan dicetak
$handle = fopen($file, 'w');
$dss=chr(27).chr(71);
$dse=chr(27).chr(72);
$initialized = chr(27).chr(64);
$load = chr(27).chr(25).chr(66);
//$initialized = chr(27)."j".chr(255).chr(27)."j".chr(100);
$condensed1 = chr(15);
$condensed = chr(27).chr(33).chr(4);
$bold1 = chr(27).chr(69);
$bold0 = chr(27).chr(70);
//$Date .= chr(27).chr(67).chr(48).chr(56); paper length
$Data = $initialized;
$Data .= "==========================\n";
$Data .= "TIN :2131321313123                                                                  CST Reg: No.: 213242424";
$Data .= "|     ".$bold1."HEADER".$bold0."      |\n";
$Data .= "      ".chr(27).chr(14)."PSN AUTOMOBILES PVT LTD".chr(20);
$Data .= "==========================\n";
$Data .= "Hello\n";
$Data .= "row 1\n";
$Data .= "row 2\n";
$Data .= "--------------------------\n";
$Data .= "--------------------------\n";
$Date .= chr(27).chr(78).chr(56); 
$Date .= chr(27).chr(79);
$Data .= "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
$Date .= $load;
fwrite($handle, $Data);
fclose($handle);
$output = shell_exec('lp -o media=Custom.10x6in aaa.txt');
//$output = shell_exec('lp aaa.txt');
//$printer = "\\\\localhost\\epson2";
//copy($file, $printer);  # Lakukan cetak
//unlink($file);
print "Hello";
?>



<style>

	td,th,body{font-size:14;font-family:'arial narrow';letter-spacing:1}
</style>
