From 41abd508e2e77ba83ee4eb5ded6e1447fcf1122d Mon Sep 17 00:00:00 2001 From: Knut Auvor Grythe Date: Mon, 30 Jun 2014 20:37:48 -0700 Subject: [PATCH 1/2] Add support for other paper sizes than A4 Add handling of the PageSize option, so other page sizes can be supported. Currently only tested with Letter, and we already know A4 works. --- pstoricohddst-gdi | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pstoricohddst-gdi b/pstoricohddst-gdi index e30351d..a580350 100755 --- a/pstoricohddst-gdi +++ b/pstoricohddst-gdi @@ -33,6 +33,16 @@ user="$2" # Page title (not used at this time, "Document" instead) ptitle="$3" my="$0" +options="$5" + +pagesize="A4" +for opt in $options; do + case "$opt" in + PageSize=*) + pagesize="$(echo "${opt#PageSize=}" | tr a-z A-Z)" + ;; + esac +done # MS-style EOL e=$(echo -en "\r") @@ -92,7 +102,7 @@ EOF @PJL SET COPIES=1$e @PJL SET MEDIASOURCE=AUTO$e @PJL SET MEDIATYPE=PLAINRECYCLE$e -@PJL SET PAPER=A4$e +@PJL SET PAPER=$pagesize$e @PJL SET PAPERWIDTH=$xs$e @PJL SET PAPERLENGTH=$ys$e @PJL SET RESOLUTION=600$e @@ -157,7 +167,7 @@ EOF @PJL SET COPIES=1$e @PJL SET MEDIASOURCE=AUTO$e @PJL SET MEDIATYPE=PLAINRECYCLE$e -@PJL SET PAPER=A4$e +@PJL SET PAPER=pagesize$e @PJL SET PAPERWIDTH=$xs$e @PJL SET PAPERLENGTH=$ys$e @PJL SET RESOLUTION=600$e From 8b32784283cb14d5c9845f6d7fa931a118b3b851 Mon Sep 17 00:00:00 2001 From: Knut Auvor Grythe Date: Mon, 30 Jun 2014 20:42:57 -0700 Subject: [PATCH 2/2] Update help to reflect that A4 is no longer hardcoded --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db1851e..666bf4b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ Driver and CUPS filter for Ricoh Aficio SP-100 family laser printers Current restrictions: - - A4 - hardcoded + - Only tested with A4 and Letter paper - 600 dpi - hardcoded - Does not count dots -- 1132782 per page hardcoded