Print automatically to local printer

2
This thread raises the question how to print a file automatically to a local printer. Are there besides the Google Cloud printing and the SFTP solution other alternatives to do this? We need functionality to print a file to a local printer, which printer is depending on the content of the file.
asked
2 answers
1

The best way locally seems to be google cloud printing, this seems very easy to implement as it is just a REST API.

But otherwise if the server is local then a printer can be connected to it and you can follow the standard way of printing files in Java.

There are several examples of "PrintJobWatcher" out there, simply search for "javax.print" or "PrintService" Java Example" you will get results like the following :

http://kalanir.blogspot.com/2010/10/how-to-print-from-java-jps-javaxprint.html

http://www.javaexperience.com/java-file-printing-example-to-print-files-in-java/

If you guys still have a problem just email me directly. The second link seems to be very helpful.

Sorry for not giving code for a mendix java action but those examples should be sufficient to implement print functionality.

answered
0

I think stack overflow has some answers: http://stackoverflow.com/questions/11230502/how-to-use-java-to-print-on-a-network-printer See also the documentation for the Java PrintService: http://docs.oracle.com/javase/8/docs/technotes/guides/jps/spec/JPSTOC.fm.html

Regards,

Ronald

answered