aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/page/pdfprolog.ps
blob: c4c31c923a94314567f8e1f1ea977858bbcbd3ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/Page null def
/Page# 0 def
/PDFSave null def
/DSCPageCount 0 def
/DoPDFPage {dup /Page# exch store pdfgetpage mypdfshowpage } def

/pdfshowpage_mysetpage {	% <pagedict> pdfshowpage_mysetpage <pagedict>
  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		% <pagedict> 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