Jump to content

[ASK] PHP PRINT FILE VIA DOS COMMAND


Lightzero

Recommended Posts

Hello....

I have some problem in Print File (I'm using LX300) via dos command..

I'm using This Code :

		
$Input ="TYPE  ".$FileName." > ".$_SESSION["Printer"];	
system($Input,$value);

 

I have some question :

1. How to get Error Command if Print is failed ?? I only know if $value is 1, the print failed, but I want to see the description like in dos... ex :

- Device is not ready

- Network path is not found

- The queue is full ...

 

2. The next problem is I only can print if I'm using PRINT SERVER (hardware), If I'm using Printer in computer client, it will failed...

Example :

Server is Computer A,

Client is Computer B (ex. IP and his printer is : //192.10.40.1/LX300)...

If I'm run the script above from Computer B, it will failed....

But If I'm run the script above from Computer A, it will successfull.

But If I'm using Printer attached in Print Server, It will success...

 

Is there any sollution...

Thank you..

Link to comment
https://forums.phpfreaks.com/topic/57187-ask-php-print-file-via-dos-command/
Share on other sites

1. Use shell_exec.

2. You'll need to be clearer, but basically. The script will only be able to print via a printer the server (machine running the script) has access to.

 

1. Can you give me some example with my code...

    Because I'm using :

shell_exec($input);

I can't get the status if the command is failed or success...  , and i'm also can't get error message. Like my previous command : system($input,$value)

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.