Google 网上论坛不再支持新的 Usenet 帖子或订阅项。历史内容仍可供查看。

Customize the print setting

已查看 55 次
跳至第一个未读帖子

SndRox

未读,
2006年9月29日 04:27:552006/9/29
收件人
Hi all,
I'm finalizing an application in xul (standalone application) and need
to insert some printing in it.

The best solution I found is to have a hidden browser to store html to
be printed, this html is created from the xul document I want to print.

Everything went well but I would like to remove the file location
header included in the default printing setting.

I've been browsing in reference with no luck,
anybody here with a hint?

Thanks in advance,
Sandro

Igor Tandetnik

未读,
2006年9月29日 10:50:392006/9/29
收件人
SndRox <sandro....@gmail.com> wrote:
> I'm finalizing an application in xul (standalone application) and need
> to insert some printing in it.
>
> The best solution I found is to have a hidden browser to store html to
> be printed, this html is created from the xul document I want to
> print.
>
> Everything went well but I would like to remove the file location
> header included in the default printing setting.

See http://www.xulplanet.com/references/elemref/ref_iframe.html, the
first user note at the bottom. Change this line

var settings = PrintUtils.getPrintSettings();

to this

var settings = PrintUtils.getPrintSettings().clone();
settings.docURL = " "; // suppress URL on printout

Other options you can modify are documented here:

http://www.xulplanet.com/references/xpcomref/ifaces/nsIPrintSettings.html

Igor Tandetnik


SndRox

未读,
2006年9月29日 14:36:182006/9/29
收件人
Great, that worked!
I'm curious as well about the way to display the application
preferences as others do, see Celtx that insert a print menu options in
the Mozilla default print dialog.

Sandro Rossetti
> Igor Tandetnik

0 个新帖子