veledrom 32 Master Poster

Hi,

I can print anything from any software. When I check the properties of my (hp LaserJet 1320), the 'owner' column has the name of my Windows XP login account which is 'Fella'. All fine up to here.

When use code below, the properties of my (hp LaserJet 1320), the 'owner' column says 'SYSTEM' which stops me printing anything.

<?php 
$printer = "\\\\lukaka\\hp LaserJet 1320"; 
if($ph = printer_open($printer)) 
{ 
   // Get file contents 
   $fh = fopen("testfile.txt", "rb"); 
   $content = fread($fh, filesize("testfile.txt")); 
   fclose($fh); 
        
   // Set print mode to RAW and send PDF to printer 
   printer_set_option($ph, PRINTER_MODE, "RAW"); 
   printer_write($ph, $content); 
   printer_close($ph); 
} 
else "Couldn't connect..."; 
?>

Is there any chance to set 'Owner' property to 'Fella' in this code so I can probably print?

FYI: php.net site says "If you cannot print on a client shared printer, you may create a admin user account, and assign it to run Apache under Windows Service." How do I do this. I am a home user, no network.

Thanks in advance guys

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.