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
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)

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.