Correct problem with page(1) reported by Peter Cejchan, which turned out to be incorrect handling of (rare) PDF files with a CropBox inset within the MediaBox. The accompanying demo file croptest.ps (which I don't expect you to copy to sources) illustrates the effect: it prints text in four orientations, translated to each quadrant of the page - 16 pages in all. When translated with ps2pdf and viewed with page, the result should be cropped to the correct quadrant and displayed with text upright. Notes: Sat May 14 12:01:20 EDT 2005 rsc Thanks for tracking this down. Reference: /n/sources/patch/applied/page-pdf-crop Date: Fri May 13 12:30:40 CES 2005 Reviewed-by: rsc --- /sys/src/cmd/page/pdfprolog.ps Fri May 13 12:17:19 2005 +++ /sys/src/cmd/page/pdfprolog.ps Fri May 13 12:17:17 2005 @@ -8,7 +8,10 @@ dup /CropBox pget { boxrect 2 array astore /PageSize exch 4 2 roll - neg exch neg exch 2 array astore /PageOffset exch + 4 index /Rotate pget { + dup 0 lt {360 add} if 90 idiv {exch neg} repeat + } if + exch neg exch 2 array astore /PageOffset exch << 5 1 roll >> setpagedevice } if } bind def --- /sys/src/cmd/page/croptest.ps Thu Jan 1 00:00:00 1970 +++ /sys/src/cmd/page/croptest.ps Fri May 13 12:17:29 2005 @@ -0,0 +1,73 @@ +%!PS-Adobe-3.0 +%%BoundingBox: 0 0 595 842 +%%EndComments +%%BeginProlog +/Helvetica findfont 100 scalefont setfont +/test { +gsave +.5 .5 scale +dup 1 and exch -1 bitshift exch +842 mul exch 595 mul exch translate +{ 90 rotate 0 -444 translate } repeat +newpath +72 72 moveto 372 72 lineto 372 372 lineto 72 372 lineto +closepath stroke +82 82 moveto show +showpage +grestore +} def +%%EndProlog +%%BeginSetup +systemdict /setdistillerparams known { + << /CompressPages false >> setdistillerparams +} if +%%EndSetup +%%Page: 1 +[/CropBox [0 0 297 421] /PAGE pdfmark +(1.1) 0 0 test +%%Page: 2 +[/CropBox [0 0 297 421] /PAGE pdfmark +(1.2) 1 0 test +%%Page: 3 +[/CropBox [0 0 297 421] /PAGE pdfmark +(1.3) 2 0 test +%%Page: 4 +[/CropBox [0 0 297 421] /PAGE pdfmark +(1.4) 3 0 test +%%Page: 5 +[/CropBox [0 421 297 842] /PAGE pdfmark +(2.1) 0 1 test +%%Page: 6 +[/CropBox [0 421 297 842] /PAGE pdfmark +(2.2) 1 1 test +%%Page: 7 +[/CropBox [0 421 297 842] /PAGE pdfmark +(2.3) 2 1 test +%%Page: 8 +[/CropBox [0 421 297 842] /PAGE pdfmark +(2.4) 3 1 test +%%Page: 9 +[/CropBox [297 0 595 421] /PAGE pdfmark +(3.1) 0 2 test +%%Page: 10 +[/CropBox [297 0 595 421] /PAGE pdfmark +(3.2) 1 2 test +%%Page: 11 +[/CropBox [297 0 595 421] /PAGE pdfmark +(3.3) 2 2 test +%%Page: 12 +[/CropBox [297 0 595 421] /PAGE pdfmark +(3.4) 3 2 test +%%Page: 13 +[/CropBox [297 421 595 842] /PAGE pdfmark +(4.1) 0 3 test +%%Page: 14 +[/CropBox [297 421 595 842] /PAGE pdfmark +(4.2) 1 3 test +%%Page: 15 +[/CropBox [297 421 595 842] /PAGE pdfmark +(4.3) 2 3 test +%%Page: 16 +[/CropBox [297 421 595 842] /PAGE pdfmark +(4.4) 3 3 test +%%EOF