Bug 545821 - XREF table error and /undefined in /BXlevel erro when converting PDF 1.5 to PNG image
Summary: XREF table error and /undefined in /BXlevel erro when converting PDF 1.5 to P...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ghostscript
Version: 5.4
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Tim Waugh
QA Contact: QE Internationalization Bugs
URL:
Whiteboard:
: 524282 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-12-09 12:46 UTC by Olivier Fourdan
Modified: 2018-11-14 17:58 UTC (History)
7 users (show)

Fixed In Version: ghostscript-8.70-1.el5
Doc Type: Bug Fix
Doc Text:
When converting a PDF 1.5 document to PNG, running the gs command resulted in the following error message: ERROR: /undefined in /BXlevel This has been fixed, and the conversion from PDF 1.5 to PNG no longer fails with the above error.
Clone Of:
Environment:
Last Closed: 2011-01-13 22:06:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch (32.61 KB, patch)
2009-12-09 12:47 UTC, Olivier Fourdan
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0137 0 normal SHIPPED_LIVE ghostscript bug fix and enhancement update 2011-01-12 19:26:44 UTC

Description Olivier Fourdan 2009-12-09 12:46:22 UTC
Description of problem:

Converting pdf-1.5 document to a png image causes an "/undefined in /BXlevel" in ghostscript-8.15

Version-Release number of selected component (if applicable):

ghostscript-8.15.2-9.11

How reproducible:

Always with given test pdf file

Steps to Reproduce:
1. Save PDF file to test.pdf
2. Run:

   $ gs -dSAFER -dNOPAUSE -dBATCH -dFirstPage=1 -dLastPage=30 -sDEVICE=png16m -sOutputFile=test.png  test.pdf
  
Actual results:

ESP Ghostscript 815.02 (2006-04-19)
Copyright (C) 2004 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
   **** Warning:  An error occurred while reading an XREF table.
   **** The file has been damaged.  This may have been caused
   **** by a problem while converting or transfering the file.
   **** Ghostscript will attempt to recover the data.
ERROR: /undefined in /BXlevel
Operand stack:
   1   --dict:6/6(ro)(G)--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   1   3   %oparray_pop   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   --nostringval--   %loop_continue   --nostringval--
Dictionary stack:
   --dict:1121/1686(ro)(G)--   --dict:0/20(G)--   --dict:107/200(L)--   --dict:107/200(L)--   --dict:104/127(ro)(G)--   --dict:241/347(ro)(G)--   --dict:18/24(L)--
Current allocation mode is local
ESP Ghostscript 815.02: Unrecoverable error, exit code 1


Expected results:

ESP Ghostscript 815.02 (2006-04-19)
Copyright (C) 2004 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
Loading NimbusRomNo9L-Regu font from /usr/share/fonts/default/Type1/n021003l.pfb... 3180904 1875258 2377112 757086 3 done.
Using NimbusRomanNo9L-Regu font for NimbusRomNo9L-Regu.
Loading NimbusRomNo9L-Medi font from /usr/share/fonts/default/Type1/n021004l.pfb... 3385384 2081240 2377112 763424 3 done.
Loading NimbusMonL-Regu font from /usr/share/fonts/default/Type1/n022003l.pfb... 3586184 2269637 2437664 816546 3 done.
Loading NimbusMonL-Bold font from /usr/share/fonts/default/Type1/n022004l.pfb... 3806496 2487118 2437664 821996 3 done.

Additional info:

The problem occurs only with PDF 1.5, works fine with 1.3. The same PDF is converted successfully with ghostscript 8.30.

Attaching patch including backport the following fixes:

 r4462:
 - This is the first pass at the changes to support the PDF 1.5 revisions
   to the PDF format.
 
 r6120:
 - Fix for double 'endstream' in a Content stream. Now endstream terminates
   the object the same way 'endobj' would. Bug 688303 for customer 670.
 
 r6920:
 - Fix for 688787 /undefined in /BXlevel.
 
 r7834:
 - Increase the size of %stdin buffer to support larger lookahead requests and
   look for for %PDF- tag in the first 1024 bytes of the file. Fix bug 687125,

 r8787:
 - Add work-around for PDF files that misspell 'endobj' as 'endjobj'. 
   Bug 689876.

 r9629:
 - Repair broken PDF files created by "OKI HotKey" that misspell "endobj"
   as "enbobj". Bug 690397.

Note that this issue is not the same as bug #517382 (the backtrace is different and the proposed patch does not address the issue in bug #517382)

Comment 1 Olivier Fourdan 2009-12-09 12:47:11 UTC
Created attachment 377168 [details]
Proposed patch

Comment 5 Jaromir Hradilek 2010-07-20 09:57:30 UTC
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.

New Contents:
When converting a PDF 1.5 document to PNG, running the gs command resulted in the following error message:

  ERROR: /undefined in /BXlevel

This has been fixed, and the conversion from PDF 1.5 to PNG no longer fails with the above error.

Comment 8 Tim Waugh 2010-08-31 10:37:55 UTC
*** Bug 524282 has been marked as a duplicate of this bug. ***

Comment 10 errata-xmlrpc 2011-01-13 22:06:45 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0137.html


Note You need to log in before you can comment on or make changes to this bug.