Bug 690684

Summary: UseCropBox option breaks pdf interpeter
Product: Ghostscript Reporter: Nikolai Tasev <nikolai>
Component: PDF InterpreterAssignee: Alex Cherepanov <alex>
Status: RESOLVED DUPLICATE    
Severity: major    
Priority: P4    
Version: 8.70   
Hardware: All   
OS: All   
Customer: Word Size: ---

Description Nikolai Tasev 2009-08-04 06:30:44 UTC
Adding the -dUseCropBox option to the GS command line 
produce the error:
Error: /stackunderflow in --index--
on pdf_main.ps line 1417: 3 index /Rotate pget not { 0 } if 90 idiv 1 and 0 ne {
exch } if

I think the problem comes from the new function /get_any_box
When there is no /CropBox defined in the PDF

/get_any_box { % <pagedict> get_any_box <box name> <box>
......
  dup type /arraytype ne {
    //systemdict /UseCropBox .knownget dup { and } if {
      /CropBox pget { /CropBox exch } if
    } if
  } if
.....

Should be 
.....
  dup type /arraytype ne {
    //systemdict /UseCropBox .knownget dup { and } if {
      dup /CropBox pget { exch pop /CropBox exch } if
    } if
  } if
.....

The same correction should be made to TrimBox.

Best Regards
Nikolai Tasev
Comment 1 Ken Sharp 2009-08-04 06:39:58 UTC

*** This bug has been marked as a duplicate of 690676 ***