Issue with uno.Print in 3.4.1
Posted: Fri Oct 26, 2012 1:10 pm
In my java OO bean implementation the document background color is grey . While giving print I need print dialog to be launched and for that the background color I am changing to white for document so that print comes as whilte in background. Once print is done changing backthe background color of docuemnt to grey color.
Using below code to achieve that
However the uno.print doesn't wait till print completes in OO3.4.1. So when change the background to grey it changes the print preview doc color also to grey.
XDispatchProvider xDispatchProvider = (XDispatchProvider)UnoRuntime.queryInterface(XDispatchProvider.class, mBean.getDocument().getCurrentController());
helper.executeDispatch(xDispatchProvider, ".uno:PrinterSetup","", 0,null
Plus when I move around printer name in printer dialog the layout of document in my OO bean changes to printlayout from weblayout. Since print is not synchronous call in uno.print even I make back to weblayout moving around printer name in printer dialog will change the layout to pritn layout.
So I have two issues
1. Background to be changed while printing(For this I tried property PrintPagebackground to false , but first time print it doesn't reflect . From 2nd time print this works)
2. Maintaining the weblayout of dcoument in OO bean
Also I thought I will display printer Setup dialog to show printer(which is synchronus call) however I won't be knowing what user chose in printer setup so that I can send the printername in print method of XPrintable.
Any help is appreciated.
Using below code to achieve that
However the uno.print doesn't wait till print completes in OO3.4.1. So when change the background to grey it changes the print preview doc color also to grey.
XDispatchProvider xDispatchProvider = (XDispatchProvider)UnoRuntime.queryInterface(XDispatchProvider.class, mBean.getDocument().getCurrentController());
helper.executeDispatch(xDispatchProvider, ".uno:PrinterSetup","", 0,null
Plus when I move around printer name in printer dialog the layout of document in my OO bean changes to printlayout from weblayout. Since print is not synchronous call in uno.print even I make back to weblayout moving around printer name in printer dialog will change the layout to pritn layout.
So I have two issues
1. Background to be changed while printing(For this I tried property PrintPagebackground to false , but first time print it doesn't reflect . From 2nd time print this works)
2. Maintaining the weblayout of dcoument in OO bean
Also I thought I will display printer Setup dialog to show printer(which is synchronus call) however I won't be knowing what user chose in printer setup so that I can send the printername in print method of XPrintable.
Any help is appreciated.