3

I import an xml file into InDesign. It contains images.

<Image href="file:///path/to/file.jpg"></Image>

This will load the image into the document, but it will be import with 72px/inch (DPI).

Is it possible to define the resolution in the tag OR width+height like in HTML?

0

1 Answer 1

1

I know this is an ancient post, but I have been dealing with this exact issue and I solved it.

There also doesn't seem to be much in terms of answers elsewhere online.

When importing images into InDesign using XML, it will assume that every image that does not have a DPI resolution speicified is 72 DPI.

With a little bit of shell scripting you can use something like ImageMagick to convert each image like so:

convert original_image.tiff -resize 500x500 -units PixelsPerInch -density 300 new_image.tiff

You can probably make a Photoshop action to do the same thing.

It may be important to specify the units you are using, as InDesign will not automatically assume that you're using DPI units and will fall back on its default 72 DPI. If you don't, then some images are going to be oversized.

You can also run a user script within InDesign to scale your images from 72 DPI to 300 DPI like so:

var images = app.activeDocument.allGraphics;
for (var i=0; i<images.length; i++) {
    images[i].horizontalScale *= 0.24;
    images[i].verticalScale   *= 0.24;
    images[i].parent.fit(FitOptions.FRAME_TO_CONTENT)
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.