Bug 693293 - pdf2ps seems to get bounding box wrong
Summary: pdf2ps seems to get bounding box wrong
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Writer (show other bugs)
Version: 9.06
Hardware: PC Linux
: P4 normal
Assignee: Ken Sharp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-22 22:21 UTC by Gervase Markham
Modified: 2012-09-13 17:12 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
The PDF file which converts incorrectly (22.57 KB, application/pdf)
2012-08-22 22:21 UTC, Gervase Markham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gervase Markham 2012-08-22 22:21:48 UTC
Created attachment 8877 [details]
The PDF file which converts incorrectly

As requested by your bug form, this bug was originally reported downstream here:
https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/1035667

However, it was agreed that it was a legitimate bug and should be reported upstream.

(Using Ubuntu Precise 12.04 LTS on a Thinkpad X220)

The attached PDF, when viewed in evince, says in the Properties:

Paper Size: 496x437mm

That is correct.

When I convert it to PS using:

pdf2ps frame_base.pdf

and then view the PS file in a text editor, it says at the start:

%%BoundingBox: 0 0 595 842

I believe this is measured in points, where 1cm is 28 points, so this translates to 212mm x 301mm. Which is not the same.

This is a problem because the "poster" program uses this info to try and work out how best to split it up into sheets for a poster, and one gets very weird results.

A commenter on the downstream bug tried it on 9.06, and reported:

"I tested your file with Ghostscript 9.06. The results are different, but still incorrect:
%%BoundingBox: 0 0 1405 0

This line should read:
%%BoundingBox: 0 0 1406 1239"

Based on that, I am reporting it here.

Gerv
Comment 1 Ken Sharp 2012-09-13 15:01:13 UTC
commit: bfae0b91bbe273318284a01d67b746b365827bb6 should resolve this. The upper right y co-ordinate should now be correctly established.

Also added the (non-standard but widely used) %%HiResBoundingBox comment.
Comment 2 Gervase Markham 2012-09-13 17:12:07 UTC
Super - thank you :-)

Gerv