From 05ab7b5c32fa3c3556d7747cdedb3eec95971a25 Mon Sep 17 00:00:00 2001 From: Michael Pfeiffer Date: Sun, 10 Oct 2004 15:44:51 +0000 Subject: [PATCH] Set the page origin to the left/top point of the printable rectangle (was page rectangle). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9275 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/print/drivers/postscript/PS.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/add-ons/print/drivers/postscript/PS.cpp b/src/add-ons/print/drivers/postscript/PS.cpp index 4164312684..c5cf8c5f86 100644 --- a/src/add-ons/print/drivers/postscript/PS.cpp +++ b/src/add-ons/print/drivers/postscript/PS.cpp @@ -19,6 +19,7 @@ #include "ValidRect.h" #include "DbgMsg.h" + #if (!__MWERKS__ || defined(MSIPL_USING_NAMESPACE)) using namespace std; #else @@ -67,8 +68,11 @@ bool PSDriver::endPage(int) } void PSDriver::setupCTM() { + const float leftMargin = getJobData()->getPrintableRect().left; + const float topMargin = getJobData()->getPrintableRect().top; // move origin from bottom left to top left - writeSpoolString("0 %f translate\n", getJobData()->getPaperRect().Height()); + // and set margin + writeSpoolString("%f %f translate\n", leftMargin, getJobData()->getPaperRect().Height()-topMargin); // y values increase from top to bottom // units of measure is dpi writeSpoolString("72 %d div 72 -%d div scale\n", getJobData()->getXres(), getJobData()->getYres());