wxHTMLEasyPrinting - PageSetup

When I print using wxHTMLEasyPrinting, the default page size is A4. How
do change the default to "Letter"?

Heimburger, Ralph P wrote:

When I print using wxHTMLEasyPrinting, the default page size is A4. How
do change the default to "Letter"?

You can't easily. I wrote my own HtmlEasyPrinting that lets you save
the settings to a wxConfig object. It also lets you change the
scaling for the fonts since they are way too large IMHO.

You can see the code at
http://cvs.sf.net/viewcvs.py/bitpim/bitpim/bphtml.py?view=markup

Look for the class HtmlEasyPrinting about half way down.

Roger

Heimburger, Ralph P wrote:

When I print using wxHTMLEasyPrinting, the default page size is A4. How
do change the default to "Letter"?

Look at the demo, it does it. (At least in 2.5.1.5)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

printout = wxHtmlPrintout("aaa")
printout.SetHtmlText("some html text to print")

# prepare configuration data
pd = wxPrintData()
# paper size
pd.SetPaperId(wxPAPER_LETTER)
pd.SetOrientation(wxPORTRAIT)
# select default printer
pd.SetPrinterName('')

# create hidden dialog for configuring printer
pdd = wxPrintDialogData()
# fill it with prepared configuration data
pdd.SetPrintData(pd)

# create printer object with our configuration
printer = wxPrinter(pdd)
# print directly, without displaying annoying dialog
printer.Print(self, printout, False)

Stano.

Heimburger, Ralph P wrote:

···

When I print using wxHTMLEasyPrinting, the default page size is A4. How
do change the default to "Letter"?