Dimensions of PDF files

General Discussion of Scripting for Adobe Bridge

Moderators: Tom, Kukurykus

Firedog

Dimensions of PDF files

Post by Firedog »

This question has been posted three or four times over the last two years by different people in the various fora that deal with Bridge, but I have not been able to find an answer. Viewing a PDF in Bridge with the option selected to Show > Dimensions (in cm) in Thumbnail preferences gives the wrong size.

I'm trying to use Bridge in compact mode as a quick source for adverts to be placed in a newspaper in Indesign CS3. If I open a PDF in Reader, the status bar tells me its precise dimensions in millimetres, for example 60.00 x 90.00. In Bridge 2.1.1.9, however, what I get for the same file is '1.8 cm x 2.7 cm @ 240 ppi', which makes no sense at all and is of no use to me. I've been searching for weeks, and have come to the conclusion that if this flaw in the Bridge coding can be corrected, it will have to be by scripting.

Does anyone have an idea how I might change the 'Dimensions (in cm)' attribute to 'Dimensions (in mm)' or (b) introduce a new attribute 'Dimensions (in mm)' and have Bridge display the correct values?

Noel
xbytor

Dimensions of PDF files

Post by xbytor »

60 = (240 * 18)/72
90 = (240 * 27)/72

The values are correct, just not in the units/resolution that you want. I suggest taking a look at the XMP/metadata file and see what's in there. You may be able to tweak the units, etc...

-X
Firedog

Dimensions of PDF files

Post by Firedog »

Thanks for responding, X - the first time anyone has!
The values are not correct. As far as I can see, the dimensions of a PDF are specified in points, and there are several sets of dimensions - e.g. size of media, size of crop box and size of art box. These are given as numbers of points from the top left hand corner of the page, so there's a bit of arithmetic required. I can't quite see which set Bridge uses, but there is no concept of 'resolution' that I can find. So why Bridge takes points values and divides them by some arbitrary figure (not always 240) to arrive at a wrong set of dimensions is beyond me, and I can only assume that it's a flaw in the coding. If it could be put right by a script, I'd be very happy, but I wouldn't know where to begin.

Where do I find the XMP file you mention to see if it could be tweaked?

Noel
Firedog

Dimensions of PDF files

Post by Firedog »

Firedog wrote:These are given as numbers of points from the top left hand corner of the page
Just for the record, that wasn't quite right. From the PDF Reference (http://www.adobe.com/devnet/pdf/pdf_reference.html):
"The CropBox entry in the page dictionary specifies the rectangle of user space corresponding to the visible area of the intended output medium (display window or printed page). The positive x axis extends horizontally to the right and the positive y axis vertically upward, as in standard mathematical practice (subject to alteration by the Rotate entry in the page dictionary). The length of a unit along both the x and y axes is 1/72 inch."

It looks like Bridge extracts the size in ~points and then treats these values as if they were pixel dimensions, which they aren't, and shows them as such in the file's properties. The figures are then converted into 'dimensions' (in or cm) by applying an arbitrary 'resolution' factor. It's just plain wrong. 170pt will always be 60mm.

Noel
xbytor

Dimensions of PDF files

Post by xbytor »

Firedog wrote:It looks like Bridge extracts the size in ~points and then treats these values as if they were pixel dimensions

Points are equivalent to pixels at a resolution of 72ppi. Bridge is not doing anything wrong at this point. Pixels have no size without a resolution. When the resolution is 72ppi, they are the same size as points.

Let's look at '1.8 cm x 2.7 cm @ 240 ppi'. I'm leaving out the inch->cm conversions since they cancel out of the equations.

1.8 cm = 18mm but the resolution of 240ppi, so we compute the number of units/pixels for this dimension

240 ppi * 18 mm = 4320 units

Divide this by the number of points per inch (72) to get the dimension

4320 units/72 pts per inch = 60mm

Bridge could display the dimension at whatever res they want as long as the length changes accordingly so that the actual number of underlying units remains the same. But displaying dimensions at something other than 72ppi doesn't make a lot of sense for PDF files which is where your problem appears to be.


FWIW, I just saved a jpg with a rez of 100ppi as as PDF. The PDF metadata panel shows the dimensions of the pdf @72ppi.

-X
Firedog

Dimensions of PDF files

Post by Firedog »

I'm really grateful to you, X for bothering to look at this with me. Your experiment with a 100ppi jpg led me to experiment myself, just to drive it home that 'Bridge gets it wrong'. I took a jpg and saved it in PSE6 at 900ppi. I then saved it as a PDF. When I view these two files in Bridge, one says that it is 5.8 x 4.3 cm @ 900 ppi, the other 0.5 x 0.3 cm @ 900 ppi. The difference, allowing for rounding (in itself a major drawback), is of course the factor of 900/72. Bridge takes the PDF physical dimensions in points and uses those as pixels. It's nonsense.

OK, now we've established that there's a shortcoming in Bridge, what can I do about it? Can I - via a script - add an extra option to those available for showing under a thumbnail? Failing that, can I amend the option Dimensions (in cm) to show actual dimensions in mm? Can I access the data that Bridge natively uses to calculate the dimensions? I don't know the first thing about JS, but I'm willing to have a go.

Noel
Firedog

Dimensions of PDF files

Post by Firedog »

Just a quick question - does this abnormal behaviour persist in CS4? If it's been fixed, I might consider upgrading...