PageSetupDialog default margins and printing html tables

david decibels.2862 at charter.net
Thu May 3 11:42:52 PDT 2007


Hi,

        I am really having an issue with printing html tables and setting up some defaults. Looked into them all and think have just confused
myself. Have looked into HtmlEasyPrinting, HtmlPrintout,.... Seems I can do part of what I want with some and some with others.
Just can't find a way to control the whole printer setup with one dialog. Now I probably have you confused. :)

        I'll start with the 'printing html tables' first:

1) I have an app I wrote that displays tables in wx.HtmlWindow . Everything looks fine and only using font size 1, which looks good
on the screen. Tables cells fit my data good. If pop the resulting html file into Firefox, everything is pretty small. But looks good
in the the HtmlWindow. Not a problem there. Where I run into problems is printing. 
        
        a)   If try to print with HtmlEasyPrinting, HtmlPrintout,... The fonts still look fine, not too small or too big, but the Cells are much
              longer than displayed, it's like everything didn't scaled proportionally. The font still looks fine, but the cells are much longer.
              Therefore the table runs off the page, even in landscape. 
              example:     display:   |   text  |       preview output:   |            text            |

So it seems to me that my only choice is to have my app write out two files. One for html display and another with smaller cells
and table width to print out.  I can say that firefox does pretty well with the printout and scaling. Maybe part of the problem is my
table code and firefox correcting for it? I am trying not tu use firefox or another browser to printout though. I did try the wxmozilla,
but couldn't get it to work with my Thread. Plus, I'm not sure that would correct the printing issue. 
I was able to get my cells to print out before all on one page but didn't like the way the text wrapped in the cell. Destroyed the
look I was trying to achieve. Wish it would just scale the html page down. 

Anyone else have problems with this? Do you do a printer friendly version and a display version?

2) Next issue having is with the PageSetupDialog. 

        I have some tables that are long, even on the display. So they need printed in landscape. Okay, so can call up the 
PageSetupDialog and choose that and modify the margins. But I can't seem to make the dialog come up with defaults that I
want. I want smaller margins and the ability to pick landscape, so that they show when the dialog is shown. 
        I've been messing with some of the code (PrintFrameworkSample)  from Robin Dunn's book that I have and I can set the 
margins and landscape where it is default in PrintDialogData. But not in PageSetupDialog, you can't seem to send defaults to it, 
at least where the dialog shows them. So I like being able to set the defaults with PrintDialogData, but you don't have the choice of 
changing them with that dialog after it comes up. Where as you do with PageSetupDialog, but can't set defaults. 
        
So am I correct that you cannot setup for example PageSetupDialog where it will show LANDSCAPE, inches, and my own margins?
It will always have it's own defaults?  This is what I am talking about where can do somethings with one and not the other.


Am I wrong on any of this or have I confused myself and possibly you? I'm only trying to solve this cause my app might work fine on 
mine if setup one way, but someone else's printer might not. But I know some will have to be landscape and would like the user to
be able to set there own margins and not have to keep changing the defaults that come up, that I can't change.  It just seems that
I have some options in one hand, some in the other AND cannot combine them. Help would be appreciated on this. 

Thanks.

Dave




More information about the wx-users mailing list