Before telling you the issue, I'm going to present you my solution:
On windows, I have a php server (Wamp server) that fulfill a .rtf template depending on the user entry. Basically this is about quality for an industry company, the user describe hiself and then describe the issue. I save this new .rtf file with a special name : basically the type of issue encounter and then an id. This .rtf file is used on server side to generate a pdf file (always server side). I found a snipet of java code that convert my .rtf file in pdf because I print the .rtf file and like the default printer on the server is a virtual printer, pdfCreator, a pdf is create on a specific folder. The pdf will be used by the server to send an automatic email back to the client and another one for the quality.
I have a java class called Printer.java that contains on the main
Desktop.getDesktop().print(new File(args[0]));
surrounded by try catch.
This java code works very well on command line but when I tried to run it through my php server :
exec("java -cp C:\\wamp\\www\etour\\printer\\printer\\build\\classes Printer C:\\wamp\\www\etour\eparation_TB2015000001.doc");
It doesn't work because a window prompt and in a php server (apparently) you cannot open a window. When you call Desktop.getDesktop().print() with an rtf file, like Microsoft Words is defined to open by default this kind of file, java will try to open Words. While calling by command line, Words open, print the file and then close automaticly but when I call it by php, the server nerver stop (infinite spin) on my page and wamp stop the process after 90 secs.
Any idea ?
Thanks for your help guys.