0

印刷ジョブが多いこの xul オフライン アプリケーションを実行しています。完了したと言って、xul print から進行状況/リスナーを取得する方法はありますか? 私はしばらくこれで立ち往生しています。続行する方法についていくつかのアイデアを共有してください。印刷用のコードは次のとおりです。

xulファイル

<iframe type="content-primary" flex="1" src="index.html"  />

印刷機能

function getWebBrowserPrint()
{
return _content.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebBrowserPrint);
}

function printpdf() {
var webBrowserPrint= getWebBrowserPrint();
var gPrintSettings = webBrowserPrint.globalPrintSettings;

gPrintSettings.footerStrLeft = "";
gPrintSettings.footerStrCenter = "";
gPrintSettings.footerStrRight = "";
gPrintSettings.headerStrLeft = "";
gPrintSettings.headerStrCenter = "";
gPrintSettings.headerStrRight = "";
gPrintSettings.printSilent = true;
gPrintSettings.showPrintProgress = true;
gPrintSettings.printerName = "PDF Writer";
webBrowserPrint.print(gPrintSettings, null);
}
4

1 に答える 1

0

の 2 番目のパラメータは、 nsIWebProgressListenerオブジェクトにするwebBrowserPrint.printことができます。特に、印刷が終了したときを含むフラグ付きのコールバックを取得します。onStateChangeSTATE_STOP

于 2011-02-19T00:23:08.780 に答える