david wrote:
> Well, that went quicker than I thought. I figured out why my app wasn't
> changing the printdialog landscape setting,....
> In my app I was using 'printer = html.HtmlEasyPrinting()' instead of
> declaring it for the whole class. So moved it to initialization of the
> class and changed to self.printer=html.HtmlEasyPrintint() and
> now it works. Changes to landscape and paperid.
>
> I didn't realize I had to declare it for the whole class. Thought could
> just use it as a local in the print function in the main class.It doesn't necessarily have to be tied to the whole class, but just has
to persist long enough that the settings saved in it from the print
dialogs is still there when the printing is done.
Then maybe it isn't persisting long enough when I do this:
Bind the print button to onPrintDisplay and
def onPrintDisplay(self,event):
printer = html.HtmlEasyPrinting()
printer.GetPrintData().SetPaperId(wx.PAPER_LEGAL)
printer.GetPrintData().SetOrientation(wx.LANDSCAPE)
printer.GetPageSetupData().SetMarginTopLeft((10,10))
printer.GetPageSetupData().SetMarginBottomRight((10,10))
#linux
printer.PreviewFile("StatusReports.html")
> Still have the problem though with the actual print out and preview
> from the dialog in Linux. Windows works.
>
> Recap:
>> I have tried the linux wxPython demo and if you use the
>> 'More Window Controls/HtmlWindow' there is my
>> problem. If you chose 'print' then from printdialog chose 'Landscape'
>> then chose 'Print Preview'. It changes the paper to Landscape but the
>> actual contents of the pages is still Portrait. This doesn't happen on
>> the windows demo.It works for me in my current 2.8 workspace. I expect that this is one
of the recent bug fixes.
Robin Dunn
Yes, this is weird. I just redownloaded and installed the latest release
of wxPython this morning dated: May 14, 2007 from sourceforge. Installed
that. It is the same date as the windows one I installed.
That is the one that I report on above that does that. So I am not sure, but
your current 2.8 workspace might be more up-to-date than mine since you
are the man.
So I am using a build that was released into the wild on May 14th. Not
using one that I have modified or has some new versions of some files.
My src/gtk/gnome/gprint.cpp is version 1.53.2.1 which is 6 versions old.
But I haven't gotten the latest wxGTK to compile. So can't try them I think
until a newer wxPython comes out.
Also I was just working on someone else's box and tried their gnumeric.
Since it uses the printdialog. Everything worked. Came home and tried
mine and same thing as my app, demo. Printdialog preview and printout
not right, still portrait.
*****Might just be libgnomeprint since Gnumeric doesn't rely on wxGTK.
I need to look into this more?
So, I'm getting a little bit flustered, cause one thing get's fixed and still
not at my goal of printing out the html tables the way need to. BUT am
getting there and much futher than when started. I'm going to reemerge
the Demo, but I don't think it will change since it uses the same code.
But worth a shot. The windows version works though, I think that irks
me the most. Arrrgh!
> david@decibels ~/temp4 $ python printtest.py
> (python:575): GLib-GObject-WARNING **: invalid (NULL) pointer instance
> (python:575): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion
> `G_TYPE_CHECK_INSTANCE(instance)' failed
I think these have something to do with the printer config. I only get
them when I choose to output to a PDF file, not when I print to my
physical printer. It's probably ok to ignore them.
I think it might be fixed in the newer versions?! Will have to test them
out when next wxPython comes with them. This comes up on mine as soon
as hit the 'Print' button and the printdialog comes up. Not chosing PDF and
doesn't do it when actually print or if change the dialog settings manually.
Just when the dialog comes up.
Just ran another test and will do it even if don't change any of the settings
and just have it bring up the printdialog. I took out the orient, paperid, margins.
Still does it. Oh, well. They don't seem to affect anything and I agree
with you on ignore them, for now.
Thanks,
Dave