Bug 688771

Summary: handle PDF files without a mediabox
Product: Ghostscript Reporter: Ralph Giles <ralph.giles>
Component: PDF InterpreterAssignee: Alex Cherepanov <alex>
Status: NOTIFIED FIXED    
Severity: enhancement    
Priority: P2    
Version: 8.54   
Hardware: PC   
OS: All   
Customer: 581 Word Size: ---
Attachments: patch

Description Ralph Giles 2006-06-26 21:20:43 UTC
Ghostscript fails on files that do not include a MediaBox. This is an invalid
file, but Acrobat and evince both render it.

The customer reports that gsview can also render the file given a target page
size. I'm not sure if this is a regression or if there's a work-around.
Comment 1 Ralph Giles 2006-06-26 21:21:14 UTC
Created attachment 2306 [details]
02277430A.pdf
Comment 2 Dan Coby 2006-06-26 22:59:37 UTC
Note:  The file works with 8.00 but not 8.11.
Comment 3 Ralph Giles 2006-06-27 11:24:20 UTC
Customer suggested just using /PageSize from the currrentpagedevice dict if the
/MediaBox pget fails.
Comment 4 Ralph Giles 2006-06-28 10:03:52 UTC
we'll do this.
Comment 5 Alex Cherepanov 2006-06-28 15:58:32 UTC
Ralph, I want this bug because it affects the same parts of the code
as bug 688744, which is already assigned to me.

The proposed patch for the bug 688744 assumes that /MediaBox is always
present. Probably, the patch should be modified to fix both bugs.
Comment 6 Ralph Giles 2006-06-28 16:12:22 UTC
Fine by me. The fix is straightforward.
Comment 7 Alex Cherepanov 2006-07-01 14:51:26 UTC
Created attachment 2319 [details]
patch

Use /PageSize from the currrent page device dictionary when the /MediaBox pget
fails.

DIFFERENCES:
Testing now.

The fix for the bug 688744 will be updated after this fix is committed.
Comment 8 Alex Cherepanov 2006-07-03 07:53:19 UTC
There's no significant differences.

Insignificant differences are:
409-01.ps - different order of file enumeration 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.
Comment 9 Ralph Giles 2006-07-05 10:09:36 UTC
Patch is approved, please commit.
Comment 10 Alex Cherepanov 2006-07-05 11:25:04 UTC
The patch is committed as revision 6893.