1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/html/htmprint.cpp
3 // Purpose: html printing classes
4 // Author: Vaclav Slavik
7 // Copyright: (c) Vaclav Slavik, 1999
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx/wx.h".
12 #include "wx/wxprec.h"
18 #if wxUSE_HTML && wxUSE_PRINTING_ARCHITECTURE && wxUSE_STREAMS
24 #include "wx/settings.h"
25 #include "wx/msgdlg.h"
26 #include "wx/module.h"
30 #include "wx/printdlg.h"
31 #include "wx/html/htmprint.h"
32 #include "wx/wxhtml.h"
33 #include "wx/wfstream.h"
36 // default font size of normal text (HTML font size 0) for printing, in points:
37 #define DEFAULT_PRINT_FONT_SIZE 12
40 //--------------------------------------------------------------------------------
42 //--------------------------------------------------------------------------------
45 wxHtmlDCRenderer::wxHtmlDCRenderer() : wxObject()
48 m_Width
= m_Height
= 0;
50 m_Parser
= new wxHtmlWinParser();
51 m_FS
= new wxFileSystem();
52 m_Parser
->SetFS(m_FS
);
53 SetStandardFonts(DEFAULT_PRINT_FONT_SIZE
);
58 wxHtmlDCRenderer::~wxHtmlDCRenderer()
60 if (m_Cells
) delete m_Cells
;
61 if (m_Parser
) delete m_Parser
;
62 if (m_FS
) delete m_FS
;
67 void wxHtmlDCRenderer::SetDC(wxDC
*dc
, double pixel_scale
)
70 m_Parser
->SetDC(m_DC
, pixel_scale
);
75 void wxHtmlDCRenderer::SetSize(int width
, int height
)
77 wxCHECK_RET( width
, "width must be non-zero" );
78 wxCHECK_RET( height
, "height must be non-zero" );
85 void wxHtmlDCRenderer::SetHtmlText(const wxString
& html
, const wxString
& basepath
, bool isdir
)
87 wxCHECK_RET( m_DC
, "SetDC() must be called before SetHtmlText()" );
88 wxCHECK_RET( m_Width
, "SetSize() must be called before SetHtmlText()" );
92 m_FS
->ChangePathTo(basepath
, isdir
);
93 m_Cells
= (wxHtmlContainerCell
*) m_Parser
->Parse(html
);
94 m_Cells
->SetIndent(0, wxHTML_INDENT_ALL
, wxHTML_UNITS_PIXELS
);
95 m_Cells
->Layout(m_Width
);
99 void wxHtmlDCRenderer::SetFonts(const wxString
& normal_face
, const wxString
& fixed_face
,
102 m_Parser
->SetFonts(normal_face
, fixed_face
, sizes
);
105 m_Cells
->Layout(m_Width
);
106 // else: SetHtmlText() not yet called, no need for relayout
109 void wxHtmlDCRenderer::SetStandardFonts(int size
,
110 const wxString
& normal_face
,
111 const wxString
& fixed_face
)
113 m_Parser
->SetStandardFonts(size
, normal_face
, fixed_face
);
116 m_Cells
->Layout(m_Width
);
117 // else: SetHtmlText() not yet called, no need for relayout
120 int wxHtmlDCRenderer::Render(int x
, int y
,
121 wxArrayInt
& known_pagebreaks
,
122 int from
, int dont_render
, int to
)
124 wxCHECK_MSG( m_Cells
, 0, "SetHtmlText() must be called before Render()" );
125 wxCHECK_MSG( m_DC
, 0, "SetDC() must be called before Render()" );
129 pbreak
= (int)(from
+ m_Height
);
130 while (m_Cells
->AdjustPagebreak(&pbreak
, known_pagebreaks
)) {}
131 hght
= pbreak
- from
;
137 wxHtmlRenderingInfo rinfo
;
138 wxDefaultHtmlRenderingStyle rstyle
;
139 rinfo
.SetStyle(&rstyle
);
140 m_DC
->SetBrush(*wxWHITE_BRUSH
);
141 m_DC
->SetClippingRegion(x
, y
, m_Width
, hght
);
146 m_DC
->DestroyClippingRegion();
149 if (pbreak
< m_Cells
->GetHeight()) return pbreak
;
150 else return GetTotalHeight();
153 int wxHtmlDCRenderer::GetTotalWidth() const
155 return m_Cells
? m_Cells
->GetWidth() : 0;
158 int wxHtmlDCRenderer::GetTotalHeight() const
160 return m_Cells
? m_Cells
->GetHeight() : 0;
164 //--------------------------------------------------------------------------------
166 //--------------------------------------------------------------------------------
169 wxList
wxHtmlPrintout::m_Filters
;
171 wxHtmlPrintout::wxHtmlPrintout(const wxString
& title
) : wxPrintout(title
)
173 m_Renderer
= new wxHtmlDCRenderer
;
174 m_RendererHdr
= new wxHtmlDCRenderer
;
175 m_NumPages
= wxHTML_PRINT_MAX_PAGES
;
176 m_Document
= m_BasePath
= wxEmptyString
; m_BasePathIsDir
= true;
177 m_Headers
[0] = m_Headers
[1] = wxEmptyString
;
178 m_Footers
[0] = m_Footers
[1] = wxEmptyString
;
179 m_HeaderHeight
= m_FooterHeight
= 0;
180 SetMargins(); // to default values
181 SetStandardFonts(DEFAULT_PRINT_FONT_SIZE
);
186 wxHtmlPrintout::~wxHtmlPrintout()
189 delete m_RendererHdr
;
192 void wxHtmlPrintout::CleanUpStatics()
194 WX_CLEAR_LIST(wxList
, m_Filters
);
198 void wxHtmlPrintout::AddFilter(wxHtmlFilter
*filter
)
200 m_Filters
.Append(filter
);
204 wxHtmlPrintout::CheckFit(const wxSize
& pageArea
, const wxSize
& docArea
) const
206 if ( docArea
.x
> pageArea
.x
)
214 _("The document \"%s\" doesn't fit on the page "
215 "horizontally and will be truncated if printed.\n"
217 "Would you like to proceed with printing it nevertheless?"),
221 wxOK
| wxCANCEL
| wxCANCEL_DEFAULT
| wxICON_QUESTION
223 dlg
.SetExtendedMessage
225 _("If possible, try changing the layout parameters to "
226 "make the printout more narrow.")
228 dlg
.SetOKLabel(wxID_PRINT
);
230 if ( dlg
.ShowModal() == wxID_CANCEL
)
237 void wxHtmlPrintout::OnPreparePrinting()
239 int pageWidth
, pageHeight
, mm_w
, mm_h
, scr_w
, scr_h
, dc_w
, dc_h
;
240 float ppmm_h
, ppmm_v
;
242 GetPageSizePixels(&pageWidth
, &pageHeight
);
243 GetPageSizeMM(&mm_w
, &mm_h
);
244 ppmm_h
= (float)pageWidth
/ mm_w
;
245 ppmm_v
= (float)pageHeight
/ mm_h
;
247 int ppiPrinterX
, ppiPrinterY
;
248 GetPPIPrinter(&ppiPrinterX
, &ppiPrinterY
);
249 wxUnusedVar(ppiPrinterX
);
250 int ppiScreenX
, ppiScreenY
;
251 GetPPIScreen(&ppiScreenX
, &ppiScreenY
);
252 wxUnusedVar(ppiScreenX
);
254 wxDisplaySize(&scr_w
, &scr_h
);
255 GetDC()->GetSize(&dc_w
, &dc_h
);
257 GetDC()->SetUserScale((double)dc_w
/ (double)pageWidth
,
258 (double)dc_h
/ (double)pageHeight
);
260 /* prepare headers/footers renderer: */
262 m_RendererHdr
->SetDC(GetDC(), (double)ppiPrinterY
/ (double)ppiScreenY
);
263 m_RendererHdr
->SetSize((int) (ppmm_h
* (mm_w
- m_MarginLeft
- m_MarginRight
)),
264 (int) (ppmm_v
* (mm_h
- m_MarginTop
- m_MarginBottom
)));
265 if (m_Headers
[0] != wxEmptyString
)
267 m_RendererHdr
->SetHtmlText(TranslateHeader(m_Headers
[0], 1));
268 m_HeaderHeight
= m_RendererHdr
->GetTotalHeight();
270 else if (m_Headers
[1] != wxEmptyString
)
272 m_RendererHdr
->SetHtmlText(TranslateHeader(m_Headers
[1], 1));
273 m_HeaderHeight
= m_RendererHdr
->GetTotalHeight();
275 if (m_Footers
[0] != wxEmptyString
)
277 m_RendererHdr
->SetHtmlText(TranslateHeader(m_Footers
[0], 1));
278 m_FooterHeight
= m_RendererHdr
->GetTotalHeight();
280 else if (m_Footers
[1] != wxEmptyString
)
282 m_RendererHdr
->SetHtmlText(TranslateHeader(m_Footers
[1], 1));
283 m_FooterHeight
= m_RendererHdr
->GetTotalHeight();
286 /* prepare main renderer: */
287 m_Renderer
->SetDC(GetDC(), (double)ppiPrinterY
/ (double)ppiScreenY
);
289 const int printAreaW
= int(ppmm_h
* (mm_w
- m_MarginLeft
- m_MarginRight
));
290 int printAreaH
= int(ppmm_v
* (mm_h
- m_MarginTop
- m_MarginBottom
));
291 if ( m_HeaderHeight
)
292 printAreaH
-= int(m_HeaderHeight
+ m_MarginSpace
* ppmm_v
);
293 if ( m_FooterHeight
)
294 printAreaH
-= int(m_FooterHeight
+ m_MarginSpace
* ppmm_v
);
296 m_Renderer
->SetSize(printAreaW
, printAreaH
);
297 m_Renderer
->SetHtmlText(m_Document
, m_BasePath
, m_BasePathIsDir
);
299 if ( CheckFit(wxSize(printAreaW
, printAreaH
),
300 wxSize(m_Renderer
->GetTotalWidth(),
301 m_Renderer
->GetTotalHeight())) )
303 // do paginate the document
306 //else: if we don't call CountPages() m_PageBreaks remains empty and our
307 // GetPageInfo() will return 0 as max page and so nothing will be
311 bool wxHtmlPrintout::OnBeginDocument(int startPage
, int endPage
)
313 if (!wxPrintout::OnBeginDocument(startPage
, endPage
)) return false;
319 bool wxHtmlPrintout::OnPrintPage(int page
)
322 if (dc
&& dc
->IsOk())
325 RenderPage(dc
, page
);
332 void wxHtmlPrintout::GetPageInfo(int *minPage
, int *maxPage
, int *selPageFrom
, int *selPageTo
)
335 if ( m_NumPages
>= (signed)m_PageBreaks
.GetCount()-1)
336 *maxPage
= m_NumPages
;
338 *maxPage
= (signed)m_PageBreaks
.GetCount()-1;
340 *selPageTo
= (signed)m_PageBreaks
.GetCount()-1;
345 bool wxHtmlPrintout::HasPage(int pageNum
)
347 return pageNum
> 0 && (unsigned)pageNum
< m_PageBreaks
.GetCount();
352 void wxHtmlPrintout::SetHtmlText(const wxString
& html
, const wxString
&basepath
, bool isdir
)
355 m_BasePath
= basepath
;
356 m_BasePathIsDir
= isdir
;
359 void wxHtmlPrintout::SetHtmlFile(const wxString
& htmlfile
)
364 if (wxFileExists(htmlfile
))
365 ff
= fs
.OpenFile(wxFileSystem::FileNameToURL(htmlfile
));
367 ff
= fs
.OpenFile(htmlfile
);
371 wxLogError(htmlfile
+ _(": file does not exist!"));
376 wxHtmlFilterHTML defaultFilter
;
379 wxList::compatibility_iterator node
= m_Filters
.GetFirst();
382 wxHtmlFilter
*h
= (wxHtmlFilter
*) node
->GetData();
385 doc
= h
->ReadFile(*ff
);
389 node
= node
->GetNext();
393 doc
= defaultFilter
.ReadFile(*ff
);
395 SetHtmlText(doc
, htmlfile
, false);
401 void wxHtmlPrintout::SetHeader(const wxString
& header
, int pg
)
403 if (pg
== wxPAGE_ALL
|| pg
== wxPAGE_EVEN
)
404 m_Headers
[0] = header
;
405 if (pg
== wxPAGE_ALL
|| pg
== wxPAGE_ODD
)
406 m_Headers
[1] = header
;
411 void wxHtmlPrintout::SetFooter(const wxString
& footer
, int pg
)
413 if (pg
== wxPAGE_ALL
|| pg
== wxPAGE_EVEN
)
414 m_Footers
[0] = footer
;
415 if (pg
== wxPAGE_ALL
|| pg
== wxPAGE_ODD
)
416 m_Footers
[1] = footer
;
421 void wxHtmlPrintout::CountPages()
424 int pageWidth
, pageHeight
, mm_w
, mm_h
;
425 float ppmm_h
, ppmm_v
;
427 GetPageSizePixels(&pageWidth
, &pageHeight
);
428 GetPageSizeMM(&mm_w
, &mm_h
);
429 ppmm_h
= (float)pageWidth
/ mm_w
;
430 ppmm_v
= (float)pageHeight
/ mm_h
;
434 // m_PageBreaks[0] = 0;
436 m_PageBreaks
.Clear();
437 m_PageBreaks
.Add( 0);
440 pos
= m_Renderer
->Render((int)( ppmm_h
* m_MarginLeft
),
441 (int) (ppmm_v
* (m_MarginTop
+ (m_HeaderHeight
== 0 ? 0 : m_MarginSpace
)) + m_HeaderHeight
),
444 m_PageBreaks
.Add( pos
);
445 if( m_PageBreaks
.GetCount() > wxHTML_PRINT_MAX_PAGES
)
447 wxMessageBox( _("HTML pagination algorithm generated more than the allowed maximum number of pages and it can't continue any longer!"),
448 _("Warning"), wxCANCEL
| wxICON_ERROR
);
451 } while (pos
< m_Renderer
->GetTotalHeight());
456 void wxHtmlPrintout::RenderPage(wxDC
*dc
, int page
)
460 int pageWidth
, pageHeight
, mm_w
, mm_h
, scr_w
, scr_h
, dc_w
, dc_h
;
461 float ppmm_h
, ppmm_v
;
463 GetPageSizePixels(&pageWidth
, &pageHeight
);
464 GetPageSizeMM(&mm_w
, &mm_h
);
465 ppmm_h
= (float)pageWidth
/ mm_w
;
466 ppmm_v
= (float)pageHeight
/ mm_h
;
467 wxDisplaySize(&scr_w
, &scr_h
);
468 dc
->GetSize(&dc_w
, &dc_h
);
470 int ppiPrinterX
, ppiPrinterY
;
471 GetPPIPrinter(&ppiPrinterX
, &ppiPrinterY
);
472 wxUnusedVar(ppiPrinterX
);
473 int ppiScreenX
, ppiScreenY
;
474 GetPPIScreen(&ppiScreenX
, &ppiScreenY
);
475 wxUnusedVar(ppiScreenX
);
477 dc
->SetUserScale((double)dc_w
/ (double)pageWidth
,
478 (double)dc_h
/ (double)pageHeight
);
480 m_Renderer
->SetDC(dc
, (double)ppiPrinterY
/ (double)ppiScreenY
);
482 dc
->SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT
);
484 m_Renderer
->Render((int) (ppmm_h
* m_MarginLeft
),
485 (int) (ppmm_v
* (m_MarginTop
+ (m_HeaderHeight
== 0 ? 0 : m_MarginSpace
)) + m_HeaderHeight
), m_PageBreaks
,
486 m_PageBreaks
[page
-1], false, m_PageBreaks
[page
]-m_PageBreaks
[page
-1]);
489 m_RendererHdr
->SetDC(dc
, (double)ppiPrinterY
/ (double)ppiScreenY
);
490 if (m_Headers
[page
% 2] != wxEmptyString
)
492 m_RendererHdr
->SetHtmlText(TranslateHeader(m_Headers
[page
% 2], page
));
493 m_RendererHdr
->Render((int) (ppmm_h
* m_MarginLeft
), (int) (ppmm_v
* m_MarginTop
), m_PageBreaks
);
495 if (m_Footers
[page
% 2] != wxEmptyString
)
497 m_RendererHdr
->SetHtmlText(TranslateHeader(m_Footers
[page
% 2], page
));
498 m_RendererHdr
->Render((int) (ppmm_h
* m_MarginLeft
), (int) (pageHeight
- ppmm_v
* m_MarginBottom
- m_FooterHeight
), m_PageBreaks
);
504 wxString
wxHtmlPrintout::TranslateHeader(const wxString
& instr
, int page
)
509 num
.Printf(wxT("%i"), page
);
510 r
.Replace(wxT("@PAGENUM@"), num
);
512 num
.Printf(wxT("%lu"), (unsigned long)(m_PageBreaks
.GetCount() - 1));
513 r
.Replace(wxT("@PAGESCNT@"), num
);
515 const wxDateTime now
= wxDateTime::Now();
516 r
.Replace(wxT("@DATE@"), now
.FormatDate());
517 r
.Replace(wxT("@TIME@"), now
.FormatTime());
519 r
.Replace(wxT("@TITLE@"), GetTitle());
526 void wxHtmlPrintout::SetMargins(float top
, float bottom
, float left
, float right
, float spaces
)
529 m_MarginBottom
= bottom
;
531 m_MarginRight
= right
;
532 m_MarginSpace
= spaces
;
538 void wxHtmlPrintout::SetFonts(const wxString
& normal_face
, const wxString
& fixed_face
,
541 m_Renderer
->SetFonts(normal_face
, fixed_face
, sizes
);
542 m_RendererHdr
->SetFonts(normal_face
, fixed_face
, sizes
);
545 void wxHtmlPrintout::SetStandardFonts(int size
,
546 const wxString
& normal_face
,
547 const wxString
& fixed_face
)
549 m_Renderer
->SetStandardFonts(size
, normal_face
, fixed_face
);
550 m_RendererHdr
->SetStandardFonts(size
, normal_face
, fixed_face
);
555 //----------------------------------------------------------------------------
556 // wxHtmlEasyPrinting
557 //----------------------------------------------------------------------------
560 wxHtmlEasyPrinting::wxHtmlEasyPrinting(const wxString
& name
, wxWindow
*parentWindow
)
562 m_ParentWindow
= parentWindow
;
565 m_PageSetupData
= new wxPageSetupDialogData
;
566 m_Headers
[0] = m_Headers
[1] = m_Footers
[0] = m_Footers
[1] = wxEmptyString
;
568 m_PageSetupData
->EnableMargins(true);
569 m_PageSetupData
->SetMarginTopLeft(wxPoint(25, 25));
570 m_PageSetupData
->SetMarginBottomRight(wxPoint(25, 25));
572 SetStandardFonts(DEFAULT_PRINT_FONT_SIZE
);
577 wxHtmlEasyPrinting::~wxHtmlEasyPrinting()
580 delete m_PageSetupData
;
584 wxPrintData
*wxHtmlEasyPrinting::GetPrintData()
586 if (m_PrintData
== NULL
)
587 m_PrintData
= new wxPrintData();
592 bool wxHtmlEasyPrinting::PreviewFile(const wxString
&htmlfile
)
594 wxHtmlPrintout
*p1
= CreatePrintout();
595 p1
->SetHtmlFile(htmlfile
);
596 wxHtmlPrintout
*p2
= CreatePrintout();
597 p2
->SetHtmlFile(htmlfile
);
598 return DoPreview(p1
, p2
);
603 bool wxHtmlEasyPrinting::PreviewText(const wxString
&htmltext
, const wxString
&basepath
)
605 wxHtmlPrintout
*p1
= CreatePrintout();
606 p1
->SetHtmlText(htmltext
, basepath
, true);
607 wxHtmlPrintout
*p2
= CreatePrintout();
608 p2
->SetHtmlText(htmltext
, basepath
, true);
609 return DoPreview(p1
, p2
);
614 bool wxHtmlEasyPrinting::PrintFile(const wxString
&htmlfile
)
616 wxHtmlPrintout
*p
= CreatePrintout();
617 p
->SetHtmlFile(htmlfile
);
618 bool ret
= DoPrint(p
);
625 bool wxHtmlEasyPrinting::PrintText(const wxString
&htmltext
, const wxString
&basepath
)
627 wxHtmlPrintout
*p
= CreatePrintout();
628 p
->SetHtmlText(htmltext
, basepath
, true);
629 bool ret
= DoPrint(p
);
636 bool wxHtmlEasyPrinting::DoPreview(wxHtmlPrintout
*printout1
, wxHtmlPrintout
*printout2
)
638 // Pass two printout objects: for preview, and possible printing.
639 wxPrintDialogData
printDialogData(*GetPrintData());
640 wxPrintPreview
*preview
= new wxPrintPreview(printout1
, printout2
, &printDialogData
);
647 wxPreviewFrame
*frame
= new wxPreviewFrame(preview
, m_ParentWindow
,
648 m_Name
+ _(" Preview"),
649 wxPoint(100, 100), wxSize(650, 500));
650 frame
->Centre(wxBOTH
);
658 bool wxHtmlEasyPrinting::DoPrint(wxHtmlPrintout
*printout
)
660 wxPrintDialogData
printDialogData(*GetPrintData());
661 wxPrinter
printer(&printDialogData
);
663 if (!printer
.Print(m_ParentWindow
, printout
, true))
668 (*GetPrintData()) = printer
.GetPrintDialogData().GetPrintData();
675 void wxHtmlEasyPrinting::PageSetup()
677 if (!GetPrintData()->Ok())
679 wxLogError(_("There was a problem during page setup: you may need to set a default printer."));
683 m_PageSetupData
->SetPrintData(*GetPrintData());
684 wxPageSetupDialog
pageSetupDialog(m_ParentWindow
, m_PageSetupData
);
686 if (pageSetupDialog
.ShowModal() == wxID_OK
)
688 (*GetPrintData()) = pageSetupDialog
.GetPageSetupData().GetPrintData();
689 (*m_PageSetupData
) = pageSetupDialog
.GetPageSetupData();
695 void wxHtmlEasyPrinting::SetHeader(const wxString
& header
, int pg
)
697 if (pg
== wxPAGE_ALL
|| pg
== wxPAGE_EVEN
)
698 m_Headers
[0] = header
;
699 if (pg
== wxPAGE_ALL
|| pg
== wxPAGE_ODD
)
700 m_Headers
[1] = header
;
705 void wxHtmlEasyPrinting::SetFooter(const wxString
& footer
, int pg
)
707 if (pg
== wxPAGE_ALL
|| pg
== wxPAGE_EVEN
)
708 m_Footers
[0] = footer
;
709 if (pg
== wxPAGE_ALL
|| pg
== wxPAGE_ODD
)
710 m_Footers
[1] = footer
;
714 void wxHtmlEasyPrinting::SetFonts(const wxString
& normal_face
, const wxString
& fixed_face
,
717 m_fontMode
= FontMode_Explicit
;
718 m_FontFaceNormal
= normal_face
;
719 m_FontFaceFixed
= fixed_face
;
723 m_FontsSizes
= m_FontsSizesArr
;
724 for (int i
= 0; i
< 7; i
++) m_FontsSizes
[i
] = sizes
[i
];
730 void wxHtmlEasyPrinting::SetStandardFonts(int size
,
731 const wxString
& normal_face
,
732 const wxString
& fixed_face
)
734 m_fontMode
= FontMode_Standard
;
735 m_FontFaceNormal
= normal_face
;
736 m_FontFaceFixed
= fixed_face
;
737 m_FontsSizesArr
[0] = size
;
741 wxHtmlPrintout
*wxHtmlEasyPrinting::CreatePrintout()
743 wxHtmlPrintout
*p
= new wxHtmlPrintout(m_Name
);
745 if (m_fontMode
== FontMode_Explicit
)
747 p
->SetFonts(m_FontFaceNormal
, m_FontFaceFixed
, m_FontsSizes
);
749 else // FontMode_Standard
751 p
->SetStandardFonts(m_FontsSizesArr
[0],
752 m_FontFaceNormal
, m_FontFaceFixed
);
755 p
->SetHeader(m_Headers
[0], wxPAGE_EVEN
);
756 p
->SetHeader(m_Headers
[1], wxPAGE_ODD
);
757 p
->SetFooter(m_Footers
[0], wxPAGE_EVEN
);
758 p
->SetFooter(m_Footers
[1], wxPAGE_ODD
);
760 p
->SetMargins(m_PageSetupData
->GetMarginTopLeft().y
,
761 m_PageSetupData
->GetMarginBottomRight().y
,
762 m_PageSetupData
->GetMarginTopLeft().x
,
763 m_PageSetupData
->GetMarginBottomRight().x
);
768 // A module to allow initialization/cleanup
769 // without calling these functions from app.cpp or from
770 // the user's application.
772 class wxHtmlPrintingModule
: public wxModule
774 DECLARE_DYNAMIC_CLASS(wxHtmlPrintingModule
)
776 wxHtmlPrintingModule() : wxModule() {}
777 bool OnInit() { return true; }
778 void OnExit() { wxHtmlPrintout::CleanUpStatics(); }
781 IMPLEMENT_DYNAMIC_CLASS(wxHtmlPrintingModule
, wxModule
)
784 // This hack forces the linker to always link in m_* files
785 // (wxHTML doesn't work without handlers from these files)
786 #include "wx/html/forcelnk.h"
787 FORCE_WXHTML_MODULES()
789 #endif // wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE