Hi All,
I am looking for a code to print ms-word side using a servlet in client machine.
If any code or example or sugegstings available,please share...
Nothing a servlet does can cause a file to be printed on the client side. (And POI has no provisions for printing to begin with.) Why can't the user decide whether or not to print a document?
Well the user has to click a print button and the word.doc will be moved to printer for printing without displaying on the browser.
My code is working on server side not in client side.
Someway i need to use javascript to allow the printing.
But i am not findng any javascript method avail in the existing .class file that i can use to invoke at runtime.
Amarshi
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35258
7
posted
0
JavaScript can be used to invoke the "print" method that will cause the print dialog to pop up for the current web page, but it has no provisions for printing any other kind of document.
Note that the web app being allowed to print documents on the client without any user interaction would be a bad security risk; that's why it's not possible.
amarshi mohanty
Ranch Hand
Joined: Jul 01, 2008
Posts: 110
posted
0
But i am able to print pdf file directly to printer:
pdfCopy.addJavaScript("this.print({bUI: false, bSilent: true, bShrinkToFit: true});",false);
so some way has to be there to do the same with word.'
Conversion to .pdf from word will be the last idea.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35258
7
posted
0
so some way has to be there to do the same with word.
Why? PDF is very different from DOC.
amarshi mohanty
Ranch Hand
Joined: Jul 01, 2008
Posts: 110
posted
0
PDF is not a MS file.
for pdf there is iText.jar which provides all the manupilations.But less info is available for handling ms-word file using POI.jar