Bug 690684 - UseCropBox option breaks pdf interpeter
Summary: UseCropBox option breaks pdf interpeter
Status: RESOLVED DUPLICATE of bug 690676
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 8.70
Hardware: All All
: P4 major
Assignee: Alex Cherepanov
QA Contact: Bug traffic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-04 06:30 UTC by Nikolai Tasev
Modified: 2009-08-04 06:39 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***