nsIWebBrowserPrint related

"krithika" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.java
Organization http://groups.google.com
Message-ID <1173874959.647655.260260__37649.3591619239$1173875243$gmane$org@y80g2000hsf.googlegroups.com>
I have embedded mozilla in my Java application.Iam trying to us
printPreview to get number of pages.But getPrintPreviewNumPages() is
not working


Am I missing some step here.Please help.Iam stuck.

=============================
nsIInterfaceRequestor ir = (nsIInterfaceRequestor)
domwindow.queryInterface(nsIInterfaceRequestor.NS_IINTERFACEREQUESTOR_IID);

nsIWebBrowserPrint print = (nsIWebBrowserPrint)
ir.getInterface(nsIWebBrowserPrint.NS_IWEBBROWSERPRINT_IID);

 nsIPrintSettings settings=print.getGlobalPrintSettings();
 settings.setOrientation(nsIPrintSettings.kPortraitOrientation);
 settings.setPaperSize(nsIPrintSettings.kPaperSizeDefined);
 settings.setShrinkToFit(true);
 settings.setPrintReversed(false);
 settings.setPrintSilent(true);
 settings.setIsInitializedFromPrefs(true);

 print.printPreview(settings,null,null);

     	 try
	 {
		Thread.sleep(1000);
	 }catch(Exception e){}

  System.out.println("preview child dom window
"+print.getPrintPreviewNumPages());

regards,
Krith
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.