HtmlHelpController and printing

I use the HtmlHelpController to provide Help in my application. However,
when someone wants to print one of my Help screens, the HtmlHelpController
defaults the printer's paper to A4, and I haven't been able to figure out
how to access the appropriate PrintData object to set the Paper Id
appropriately.

Can anybody tell me how to get the HtmlHelpController to use wx.PAPER_LETTER
by default?

Thanks,

David K. Woods, Ph.D.
Transana Lead Developer (http://www.transana.org)
Wisconsin Center for Education Research
University of Wisconsin, Madison

  "Quick. Cheap. Good. Pick two."

David Woods <dwoods@wcer.wisc.edu> writes:

Can anybody tell me how to get the HtmlHelpController to use wx.PAPER_LETTER
by default?

This might help you with printing HTML documents:

···

======================================================================
#!/usr/bin/python -tt
# -*- encoding: iso-8859-1 -*-

from wxPython.html import wxHtmlEasyPrinting
from gridToHtml import gridToHTML
from wxPython.wx import *

class Printer(wxHtmlEasyPrinting):

    def __init__(self, frame):
        wxHtmlEasyPrinting.__init__(self)
        page_conf = self.GetPrintData()
        page_conf.SetOrientation(wxLANDSCAPE)
        self.printout = wxPrintout()
        self.frame = frame

    def GetHtmlText(self, grid, columns):
        gth = gridToHTML()
        html_text = gth.gridToHtml(grid, columns)
        return html_text

    def Print(self, grid, doc_name, columns):
        self.SetHeader(doc_name)
        self.PrintText(self.GetHtmlText(grid, columns), doc_name)

    def PreviewText(self, grid, doc_name, columns):
        self.SetHeader(doc_name)
        wxHtmlEasyPrinting.PreviewText(self, self.GetHtmlText(grid, columns))

This is what I use to print some grids. :slight_smile: This is why there's
gridToHtml on the import list. You should alter the information on the
page_conf object. But remember to allow users to change the page size
(it is really hard to find printers with letter sized paper around
here... ;-)).

Be seeing you,
--
Godoy. <godoy@ieee.org>

The issue is that the HtmlHelpController seems to have printing built into
it, and I need to figure out how to change the paper in that internal print
controler. As far as I know, there's no way for me to substitute my own
code for the print routines built into the HtmlHelpController.

David

···

-----Original Message-----
From: news [mailto:news@sea.gmane.org]On Behalf Of Jorge Godoy
Sent: Monday, November 15, 2004 11:14 AM
To: wxpython-users@lists.wxwindows.org
Subject: [wxPython-users] Re: HtmlHelpController and printing

David Woods <dwoods@wcer.wisc.edu> writes:

> Can anybody tell me how to get the HtmlHelpController to use
wx.PAPER_LETTER
> by default?

This might help you with printing HTML documents:

======================================================================
#!/usr/bin/python -tt
# -*- encoding: iso-8859-1 -*-

from wxPython.html import wxHtmlEasyPrinting
from gridToHtml import gridToHTML
from wxPython.wx import *

class Printer(wxHtmlEasyPrinting):

    def __init__(self, frame):
        wxHtmlEasyPrinting.__init__(self)
        page_conf = self.GetPrintData()
        page_conf.SetOrientation(wxLANDSCAPE)
        self.printout = wxPrintout()
        self.frame = frame

    def GetHtmlText(self, grid, columns):
        gth = gridToHTML()
        html_text = gth.gridToHtml(grid, columns)
        return html_text

    def Print(self, grid, doc_name, columns):
        self.SetHeader(doc_name)
        self.PrintText(self.GetHtmlText(grid, columns), doc_name)

    def PreviewText(self, grid, doc_name, columns):
        self.SetHeader(doc_name)
        wxHtmlEasyPrinting.PreviewText(self,
self.GetHtmlText(grid, columns))

This is what I use to print some grids. :slight_smile: This is why there's
gridToHtml on the import list. You should alter the information on the
page_conf object. But remember to allow users to change the page size
(it is really hard to find printers with letter sized paper around
here... ;-)).

Be seeing you,
--
Godoy. <godoy@ieee.org>

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

David Woods wrote:

I use the HtmlHelpController to provide Help in my application. However,
when someone wants to print one of my Help screens, the HtmlHelpController
defaults the printer's paper to A4, and I haven't been able to figure out
how to access the appropriate PrintData object to set the Paper Id
appropriately.

Can anybody tell me how to get the HtmlHelpController to use wx.PAPER_LETTER
by default?

There doesn't seem to be a way to do it. Please enter a Feature Request asking for it.

···

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