Matrix printer printing, networked, with PHP

Asked

Viewed 131 times

1

Good afternoon.

I am trying to send a simple txt file to the network printer. The server is Windows, php 5.6 and is in a VPS. The printer is configured by VPN.

I tried installing the php_printer dll, but PHP did not recognize the library.

If I send via CMD, using the command below, it works:

Get-Content ".txt file" | Out-Printer Network Printer

However, running this same command via exec in PHP will not. I have tried using Systema, passthru, etc. nothing works.

Does anyone have any light for this case? I thank you in advance.

  • 1

    What would be the result of: exec('Get-Content ".txt file" | Out-Printer network printer 2>&1', $output); print_r($output); ?

  • Appeared array();

  • I did it this way. error_reporting(E_ALL); $printer = "SCX-3400"; $command = "Get-Content map.txt | Out-Printer $printer"; exec($command, $output); print_r($output);

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.