Skip to main content
cdpage905
Participating Frequently
July 7, 2017
Answered

Dimensions of Documents in Bridge MetaData window... AI, PDF, ect

  • July 7, 2017
  • 3 replies
  • 4521 views

Can the Illustrator team please ad a line into their metadata that bridge can access. Obviously illustrator knows the size of the document... why can't bridge?

Bridge should have under Dimension the following:

Default to Document measurement = What ever the document is saved as (pixel, cm, in)

Select to Measurement: Pixel, cm, in

Please don't tell me that it's "Vector" and that vector can be any size you want. that's not the point. It's an Illustrator file (ie a poster or a print ad with Pixel Data such as jpgs or tiff placed in the artwork)

ALSO Bridge should include Artwork exceeds art board: Yes/No (this would be good for Bleed info or additional artwork material the Preview icon can't display)

This topic has been closed for replies.
Correct answer Stephen Marsh

Bridge CC 2018 still has limitations with multiple pages, page 2 reports the same page size as page 1, when it is different.

 

If the AI or PDF file is a single artboard or page, then:

 

A4 page – 21cm wide = 595px x 2.54cm / 72 (width in pixels multiplied by 2.54 divided by 72). For inches, it would be a little simpler, 595px / 72. PDF files use PostScript Points as the native unit of measure, which are 1/72".

 

For those with the knowledge (not me), it should be pretty easy to create an Inspector panel to report on the width and height of a single page document, using the px to cm or in conversion outlined in the previous paragraph.

3 replies

Stephen Marsh
Community Expert
Community Expert
October 3, 2022

 

Until Adobe adds this as a native feature, one way is via an inspector panel. The following scripts only show info for the first page.

 

Inspector panel for AI/PDF page size in inches:

 

// https://forums.adobe.com/message/3903326#3903326
// https://forums.adobe.com/message/9032111#9032111
#target bridge

function SizeDetails() {
   var mpp = new InspectorPanel("Metric Document Dimensions");
   this.panelRef = mpp;
   var zzz = [
      ["Document Dimensions in Inches", "[[javascript:getDetails()]]"]
   ];
   var tp = new TextPanelette("Document Dimensions", "", "[[this]]", zzz);
   mpp.registerPanelette(tp);
   app.registerInspectorPanel(mpp);
   try {
      app.document.displayInspectorView = true;
   } catch (e) {};
}

function getDetails() {
   var retval = "\r";
   for (var i = 0; i < app.document.visibleThumbnails.length; i++) {
      var thumb = app.document.visibleThumbnails[i];
      if (thumb.type != "file") continue;
      app.synchronousMode = true;
      thumb.core.preview.preview;
      app.synchronousMode = false;
      var Resolution = 0;
      var height = thumb.core.quickMetadata.height;
      var width = thumb.core.quickMetadata.width;
      Resolution = thumb.core.quickMetadata.xResolution;
      if (Resolution == 0) Resolution = 72;
      var Width = (width / Resolution).toFixed(2);
      var Height = (height / Resolution).toFixed(2);
      retval += decodeURI(thumb.spec.name) + "\n" + "W = " + Width + " inches x H = " + Height + " inches\r\r";
   }
   return retval;
}
SizeDetails();

 

Inspector panel for AI/PDF page size in metric CM:

 

// https://forums.adobe.com/message/3903326#3903326
// https://forums.adobe.com/message/9032111#9032111
#target bridge

function SizeDetails() {
   var mpp = new InspectorPanel("Metric Document Dimensions");
   this.panelRef = mpp;
   var zzz = [
      ["Document Dimensions in Centimetres", "[[javascript&colon;getDetails()]]"]
   ];
   var tp = new TextPanelette("Document Dimensions", "", "[[this]]", zzz);
   mpp.registerPanelette(tp);
   app.registerInspectorPanel(mpp);
   try {
      app.document.displayInspectorView = true;
   } catch (e) {};
}

function getDetails() {
   var retval = "\r";
   for (var i = 0; i < app.document.visibleThumbnails.length; i++) {
      var thumb = app.document.visibleThumbnails[i];
      if (thumb.type != "file") continue;
      app.synchronousMode = true;
      thumb.core.preview.preview;
      app.synchronousMode = false;
      var Resolution = 0;
      var height = thumb.core.quickMetadata.height;
      var width = thumb.core.quickMetadata.width;
      Resolution = thumb.core.quickMetadata.xResolution;
      if (Resolution == 0) Resolution = 72;
      var Width = (width * 2.54 / Resolution).toFixed(2);
      var Height = (height * 2.54 / Resolution).toFixed(2);
      retval += decodeURI(thumb.spec.name) + "\n" + "W = " + Width + " cm x H = " + Height + " cm\r\r";
   }
   return retval;
}
SizeDetails();

 

One can go further and truncate, round to the nearest required number of decimal places etc. 

 

These scripts could use some refinement, such as only showing info for AI/PDF files or perhaps only for the active selected document rather than the entire directory. I don't do much Bridge scripting, I'm sure that @Lumigraphics could make short work of such tasks.

 

Edit: The following code can be used by right-clicking on selected files in Bridge.

 

Contextual Menu Item in Metric CM (rounded):

 

// https://forums.adobe.com/message/9032111#9032111
// https://forums.adobe.com/message/10365909#10365909
#target bridge
if (BridgeTalk.appName == "bridge") {
    pdfai = MenuElement.create("command", "PDF and AI dimensions", "at the end of Thumbnail", "pdfai");
}
pdfai.onSelect = function () {
    var w = new Window("dialog", "PDF/AI dimensions");
    w.alignChildren = "fill", "fill";
    w.p1 = w.add("panel", undefined, undefined, {
        borderStyle: "black"
    });
    w.p1.preferredSize = [900, 400];
    w.g1 = w.p1.add("group");
    w.g1.alignment = ["fill", "fill"];
    w.g1.orientation = "column";
    w.g1.st1 = w.g1.add("statictext", undefined, "");
    w.g1.st1.graphics.font = ScriptUI.newFont("Tahoma", 0, 16);
    w.g1.lb1 = w.g1.add("edittext", undefined, undefined, {
        multiline: true
    });
    w.g1.lb1.graphics.font = ScriptUI.newFont("Tahoma", 0, 16);
    w.g1.lb1.preferredSize = [890, 360];
    w.g1.bu1 = w.g1.add("button", undefined, "OK");
    w.g1.bu1.graphics.font = ScriptUI.newFont("Tahoma", 0, 16);
    w.g1.bu1.preferredSize = [860, 30];;
    w.g1.bu1.onClick = function () {
        w.close(0);
    }
    w.g1.lb1.text = getDetails();
    w.show();

    function getDetails() {
        var retval = "\r";
        var fileTypes = app.document.getSelection("ai,pdf");
        for (var i in fileTypes) {
            var thumb = fileTypes[i];
            if (thumb.type != "file") continue;
            app.synchronousMode = true;
            thumb.core.preview.preview;
            app.synchronousMode = false;
            var Resolution = 0;
            var height = thumb.core.quickMetadata.height;
            var width = thumb.core.quickMetadata.width;
            Resolution = thumb.core.quickMetadata.xResolution;
            if (Resolution == 0) Resolution = 72;
            var Width = Math.round(width * 2.54 / Resolution * 10) / 10;
            var Height = Math.round(height * 2.54 / Resolution * 10) / 10;
            retval += decodeURI(thumb.spec.name) + "\n" + "W = " + Width + " cm x H = " + Height + " cm";
            if (fileTypes.length > 1) retval += "\r";
        }
        return retval;
    }
};

 

Contextual Menu Item in Inches:

 

// https://forums.adobe.com/message/9032111#9032111
// https://forums.adobe.com/message/10365909#10365909
#target bridge
if (BridgeTalk.appName == "bridge") {
    pdfai = MenuElement.create("command", "PDF and AI dimensions", "at the end of Thumbnail", "pdfai");
}
pdfai.onSelect = function () {
    var w = new Window("dialog", "PDF/AI dimensions");
    w.alignChildren = "fill", "fill";
    w.p1 = w.add("panel", undefined, undefined, { borderStyle: "black" });
    w.p1.preferredSize = [900, 400];
    w.g1 = w.p1.add("group");
    w.g1.alignment = ["fill", "fill"];
    w.g1.orientation = "column";
    w.g1.st1 = w.g1.add("statictext", undefined, "");
    w.g1.st1.graphics.font = ScriptUI.newFont("Tahoma", 0, 16);
    w.g1.lb1 = w.g1.add("edittext", undefined, undefined, { multiline: true });
    w.g1.lb1.graphics.font = ScriptUI.newFont("Tahoma", 0, 16);
    w.g1.lb1.preferredSize = [890, 360];
    w.g1.bu1 = w.g1.add("button", undefined, "OK");
    w.g1.bu1.graphics.font = ScriptUI.newFont("Tahoma", 0, 16);
    w.g1.bu1.preferredSize = [860, 30];;
    w.g1.bu1.onClick = function () { w.close(0); }
    w.g1.lb1.text = getDetails();
    w.show();
    function getDetails() {
        var retval = "\r";
        var fileTypes = app.document.getSelection("ai,pdf");
        for (var i in fileTypes) {
            var thumb = fileTypes[i];
            if (thumb.type != "file") continue;
            app.synchronousMode = true;
            thumb.core.preview.preview;
            app.synchronousMode = false;
            var Resolution = 0;
            var height = thumb.core.quickMetadata.height;
            var width = thumb.core.quickMetadata.width;
            Resolution = thumb.core.quickMetadata.xResolution;
            if (Resolution == 0) Resolution = 72;
            var Width = Math.round(width / Resolution);
            var Height = Math.round(height / Resolution);
            retval += decodeURI(thumb.spec.name) + "\n" + "W = " + Width + " in x H = " + Height + " in\r";
            if (fileTypes.length > 1) retval += "\r";
        }
        return retval;
    }
};

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

 

Stephen Marsh
Community Expert
Community Expert
July 10, 2017

It would be nice!

 

Bridge has outgrown it’s original life as Photoshop’s file browser and has become so much more… however in many ways it has not grown up much at all.

 

Dimensions for raster image files is “easy enough”…

 

However for native Ai or PDF files, it is a harder problem to solve. Ai files can have multiple Artboard “pages” and they can all be different sizes and mix portrait and landscape orientation.

 

Bridge CC 2017 does actually indicate Dimensions for a multi-page PDF. My Ai PDF has page 1 as A4 portrait (210x297mm) and page 2 as A3 landscape (420x297mm)… however Bridge reports the dimensions as 595x842 with no unit of measure! Is this pixels, points or something else? At least the aspect ratio is the same as A4 portrait so that is something at least.

 

If I swap the page order over, then Bridge picks up that the first page is now 1191x842… However when I use the page navigation arrows in the preview panel, the reported dimensions do not update in the File Properties panel, they are stuck on page 1 values, even though page 2 is a different size and orientation.

 

So more work to be done (which has always been a constant in Bridge’s development).

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
November 19, 2017

Bridge CC 2018 still has limitations with multiple pages, page 2 reports the same page size as page 1, when it is different.

 

If the AI or PDF file is a single artboard or page, then:

 

A4 page – 21cm wide = 595px x 2.54cm / 72 (width in pixels multiplied by 2.54 divided by 72). For inches, it would be a little simpler, 595px / 72. PDF files use PostScript Points as the native unit of measure, which are 1/72".

 

For those with the knowledge (not me), it should be pretty easy to create an Inspector panel to report on the width and height of a single page document, using the px to cm or in conversion outlined in the previous paragraph.

Morazan
Known Participant
November 29, 2021

And those limitations apparently persist in 2021, almost into 2022. Yet another reason to uninstall Bridge. For my purposes, it's a slower, clunkier version of Windows Explorer, a real digital paperweight. What can one say but Adobe.