#include "wx/defs.h"
-#if wxUSE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT
#ifndef WX_PRECOMP
#include "wx/utils.h"
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptPrinter, wxPrinterBase)
IMPLEMENT_CLASS(wxPostScriptPrintPreview, wxPrintPreviewBase)
-
+
// ============================================================================
// implementation
// ============================================================================
return FALSE;
}
- int logPPIScreenX = 0;
- int logPPIScreenY = 0;
- int logPPIPrinterX = 0;
- int logPPIPrinterY = 0;
-
- logPPIScreenX = 100;
- logPPIScreenY = 100;
-
- /*
- // Correct values for X/PostScript?
- logPPIPrinterX = 100;
- logPPIPrinterY = 100;
- */
+ wxSize ScreenPixels = wxGetDisplaySize();
+ wxSize ScreenMM = wxGetDisplaySizeMM();
- logPPIPrinterX = wxPostScriptDC::GetResolution();
- logPPIPrinterY = wxPostScriptDC::GetResolution();
-
- printout->SetPPIScreen(logPPIScreenX, logPPIScreenY);
- printout->SetPPIPrinter(logPPIPrinterX, logPPIPrinterY);
+ printout->SetPPIScreen( (int) ((ScreenPixels.GetWidth() * 25.4) / ScreenMM.GetWidth()),
+ (int) ((ScreenPixels.GetHeight() * 25.4) / ScreenMM.GetHeight()) );
+ printout->SetPPIPrinter( wxPostScriptDC::GetResolution(),
+ wxPostScriptDC::GetResolution() );
// Set printout parameters
printout->SetDC(dc);
if (paper)
{
- m_previewPrintout->SetPPIScreen(100, 100);
- // m_previewPrintout->SetPPIPrinter(100, 100);
+ wxSize ScreenPixels = wxGetDisplaySize();
+ wxSize ScreenMM = wxGetDisplaySizeMM();
+
+ m_previewPrintout->SetPPIScreen( (int) ((ScreenPixels.GetWidth() * 25.4) / ScreenMM.GetWidth()),
+ (int) ((ScreenPixels.GetHeight() * 25.4) / ScreenMM.GetHeight()) );
m_previewPrintout->SetPPIPrinter(wxPostScriptDC::GetResolution(), wxPostScriptDC::GetResolution());
wxSize sizeDevUnits(paper->GetSizeDeviceUnits());