Automatically print image from web app (html, js and php)

0

Hello, I have a webapp where I take a picture with a frame for a badge and saved it on the server, however I had to send that image automatically, ignoring the prompt that comes up when we print something in the browser for example. >

I tried a software in java, I did the program that had to print in java, but when I called its execution through php exec () it does not see any print service, I asked a question about this case here already, but no I got a solution.

This will run on two machines, but each will have a local server installed, and will run in a controlled environment. So it might be some "gabiarra" itself, but since not having that prompt is a system requirement, I need some way to make it work.

Any suggestions?

    
asked by anonymous 04.04.2014 / 23:04

1 answer

1

php has a library to do this link

Use

<?php
$texto = "Conteúdo a ser impresso";
$_SESSION['PrintBuffer']="$texto"; 
$handle=printer_open("nome_da_impressora_no_windows");
printer_set_option($handle, PRINTER_MODE, "RAW");
printer_write($handle, $_SESSION['PrintBuffer']);
printer_close($handle);
?>

I did not test because there is no printer here, but I believe you will be able to get direct printing without going through a prompt.

    
16.04.2014 / 15:44