tforgot this - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
commit 9e6fcbd790d26b54b2ea054e651020645a42db1a
parent b2ad2ef1387571c7b917a7fd63e8670582ae8b7f
Author: rsc 
Date:   Tue,  4 Jan 2005 22:31:35 +0000

forgot this

Diffstat:
  A src/cmd/page/pdfprolog.ps           |      29 +++++++++++++++++++++++++++++

1 file changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/src/cmd/page/pdfprolog.ps b/src/cmd/page/pdfprolog.ps
t@@ -0,0 +1,29 @@
+/Page null def
+/Page# 0 def
+/PDFSave null def
+/DSCPageCount 0 def
+/DoPDFPage {dup /Page# exch store pdfgetpage mypdfshowpage } def
+
+/pdfshowpage_mysetpage {        %  pdfshowpage_mysetpage 
+  dup /CropBox pget {
+      boxrect
+      2 array astore /PageSize exch 4 2 roll
+      neg exch neg exch 2 array astore /PageOffset exch
+      << 5 1 roll >> setpagedevice
+  } if
+} bind def
+
+/mypdfshowpage                %  pdfshowpage -
+ { dup /Page exch store
+   pdfshowpage_init 
+   pdfshowpage_setpage 
+   pdfshowpage_mysetpage
+   save /PDFSave exch store
+   (before exec) VMDEBUG
+     pdfshowpage_finish
+   (after exec) VMDEBUG
+   PDFSave restore
+ } bind def
+
+GS_PDF_ProcSet begin
+pdfdict begin