in reply to Re^4: How to use wxHtmlEasyPrinting
in thread How to use wxHtmlEasyPrinting
... Here is my code so far:
Sorry but that won't run, you're missing $htmlwindow -- compare to my example
I have tried to use SetFonts to reduce the font sizes on the preview page. The default sizes according to the wxwidgets.org are seven integers in the range -2 to +4. However only the third value, 0 seems to have any effect. When I change this from 0 to -1 the page text becomes too small to be readable.
Try positive integers, because the docs say
sizes This is an array of 7 items of int type. The values represent size of font with HTML size from -2 to +4 ( <FONT SIZE=-2> to <FONT SIZE=+4> ). Default sizes are used if sizes is NULL.
So wxHTML_FONT_SIZE_3 is size=-1 and wxHTML_FONT_SIZE_5 is size=+1 or some such combination
So try positive integers, like these (the wxHTML_FONT_SIZE_ constants no longer appear to be public )
#ifdef __WXMSW__ #define wxHTML_FONT_SIZE_1 7 #define wxHTML_FONT_SIZE_2 8 #define wxHTML_FONT_SIZE_3 10 #define wxHTML_FONT_SIZE_4 12 #define wxHTML_FONT_SIZE_5 16 #define wxHTML_FONT_SIZE_6 22 #define wxHTML_FONT_SIZE_7 30 #elif defined(__WXMAC__) #define wxHTML_FONT_SIZE_1 9 #define wxHTML_FONT_SIZE_2 12 #define wxHTML_FONT_SIZE_3 14 #define wxHTML_FONT_SIZE_4 18 #define wxHTML_FONT_SIZE_5 24 #define wxHTML_FONT_SIZE_6 30 #define wxHTML_FONT_SIZE_7 36 #else #define wxHTML_FONT_SIZE_1 10 #define wxHTML_FONT_SIZE_2 12 #define wxHTML_FONT_SIZE_3 14 #define wxHTML_FONT_SIZE_4 16 #define wxHTML_FONT_SIZE_5 19 #define wxHTML_FONT_SIZE_6 24 #define wxHTML_FONT_SIZE_7 32 #endif
Is there any way to scale the print out to fit a letter size page?
Sorry, I don't know. I imagine its possible, see
wxperl_demo --show wxPrintPaperDatabase
wxperl_demo --show wxPrinting
If you look inside Wx::DemoModules::wxPrinting you'll see a wxPrintout subclass calling a wxDC::SetUserScale, centers/resizes the image -- but I've never tried it
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: How to use wxHtmlEasyPrinting
by halweitz (Novice) on Mar 19, 2013 at 14:28 UTC | |
by Anonymous Monk on Mar 19, 2013 at 14:50 UTC | |
by halweitz (Novice) on Mar 19, 2013 at 19:59 UTC | |
by Anonymous Monk on Mar 20, 2013 at 15:45 UTC |