-
- m_Renderer -> SetDC(dc, pageWidth);
-
- dc -> SetBackgroundMode(wxTRANSPARENT);
-
- m_Renderer -> Render(ppmm_h * m_MarginLeft,
- ppmm_v * (m_MarginTop + (m_HeaderHeight == 0 ? 0 : m_MarginSpace)) + m_HeaderHeight,
- m_PageBreaks[page-1]);
-
- m_RendererHdr -> SetDC(dc, pageWidth);
- if (m_Headers[page % 2] != wxEmptyString) {
- m_RendererHdr -> SetHtmlText(TranslateHeader(m_Headers[page % 2], page));
- m_RendererHdr -> Render(ppmm_h * m_MarginLeft, ppmm_v * m_MarginTop);
+ wxDisplaySize(&scr_w, &scr_h);
+ dc->GetSize(&dc_w, &dc_h);
+
+ int ppiPrinterX, ppiPrinterY;
+ GetPPIPrinter(&ppiPrinterX, &ppiPrinterY);
+ wxUnusedVar(ppiPrinterX);
+ int ppiScreenX, ppiScreenY;
+ GetPPIScreen(&ppiScreenX, &ppiScreenY);
+ wxUnusedVar(ppiScreenX);
+
+ dc->SetUserScale((double)dc_w / (double)pageWidth, (double)dc_w / (double)pageWidth);
+
+ m_Renderer->SetDC(dc, (double)ppiPrinterY / (double)ppiScreenY);
+
+ dc->SetBackgroundMode(wxTRANSPARENT);
+
+ m_Renderer->Render((int) (ppmm_h * m_MarginLeft),
+ (int) (ppmm_v * (m_MarginTop + (m_HeaderHeight == 0 ? 0 : m_MarginSpace)) + m_HeaderHeight),
+ m_PageBreaks[page-1], FALSE, m_PageBreaks[page]-m_PageBreaks[page-1]);
+
+ m_RendererHdr->SetDC(dc, (double)ppiPrinterY / (double)ppiScreenY);
+ if (m_Headers[page % 2] != wxEmptyString)
+ {
+ m_RendererHdr->SetHtmlText(TranslateHeader(m_Headers[page % 2], page));
+ m_RendererHdr->Render((int) (ppmm_h * m_MarginLeft), (int) (ppmm_v * m_MarginTop));