[gs-cvs] rev 6893 - trunk/gs/lib

alexcher at ghostscript.com alexcher at ghostscript.com
Wed Jul 5 11:17:52 PDT 2006


Author: alexcher
Date: 2006-07-05 11:17:52 -0700 (Wed, 05 Jul 2006)
New Revision: 6893

Modified:
   trunk/gs/lib/pdf_main.ps
Log:
Use /PageSize from the currrent page device dictionary when the /MediaBox pget
fails. Bug 688771, customer 581.

DIFFERENCES:
None expected in the regression test.
Other differences found by local testing:
409-01.ps - different order of file enumeration in .svn directory reflected
            in the raster
215-01.ps - different order of file enumeration in stdout only
Bug687615.ps - different order of dictionary enumeration in stdout only.
Multiple differences in generated PDF files in Type1C streams.


Modified: trunk/gs/lib/pdf_main.ps
===================================================================
--- trunk/gs/lib/pdf_main.ps	2006-07-05 14:03:49 UTC (rev 6892)
+++ trunk/gs/lib/pdf_main.ps	2006-07-05 18:17:52 UTC (rev 6893)
@@ -1046,6 +1046,14 @@
  { /DSCPageCount DSCPageCount 1 add store
  } bind def
 
+/get_media_box { % <pagedict> get_media_box <box>
+  /MediaBox pget not {
+    (   **** Page has no /MediaBox attribute. Using the current page size.\n)
+    pdfformaterror
+    [ 0 0 currentpagedevice /PageSize get aload pop ]
+  } if
+} bind def
+
 /.pdfshowpage_Install {	% <pagedict> [<prevproc>] .pdfshowpage_Install -
   exch
 	% We would like to clip to the CropBox here, but the subsequent
@@ -1054,7 +1062,7 @@
   dup /CropBox pget dup {exch pop} if systemdict /UseCropBox known and {
     dup /CropBox pget pop
   } {
-    dup /MediaBox pget pop	% There has to be a MediaBox
+    dup get_media_box
   } ifelse
   % stack: [<prevproc>] <pagedict> <Crop|Media Box>
   exch pop oforce_array normrect		% done with the pagedict
@@ -1146,7 +1154,7 @@
       1 index /CropBox pget dup {exch pop} if systemdict /UseCropBox known and {
         1 index /CropBox pget pop
       } {
-        1 index /MediaBox pget pop	% There has to be a MediaBox
+        1 index get_media_box
       } ifelse
       oforce_array normrect
       dup 0 get exch 1 get   % [] tx ty
@@ -1203,7 +1211,7 @@
       % (Adobe Tech Note 5407, sec 9.2)
       dup /Group knownoget {
 	1 index /CropBox knownoget not {
-	  1 index /MediaBox pget pop
+	  1 index get_media_box
 	} if oforce_array normrect .beginformgroup {
 	  showpagecontents
 	} stopped {



More information about the gs-cvs mailing list