在InDesign中自动在页面上旋转和放置图像和文本 [英] Automated rotating and placing image and text on a page in InDesign
问题描述
我的任务是拍摄一组产品图像和文本,并将它们放在小册子中(带有相面对的页面),然后在图像旁边放置产品说明。
I have been tasked with taking a set of product images and text and placing them in a booklet (with facing pages) and putting the product description next to the image.
大多数图像是横向的,而书本是纵向的,因此需要旋转。对于必须旋转的图像,我将文本放置在文本框架中,使框架适合内容,然后计算最大图像大小,然后调整大小,然后放置图像并根据是否旋转90/270度旋转该页面是左侧或右侧页面。
Most images are landscape orientation whilst the book is portrait, and so they need to be rotated. For the images that have to be rotated, I'm placing the text in a textframe, fitting the frame to the content, then calculating the max image size, to then resize and then placing the image and rotating 90 / 270 degrees depending on whether the page is a left-hand or right-hand side page. This is rather long-winded for a rather simple operation of placing the image and text and rotating.
InDesign中是否存在一种更自动化的方法,可以在其中旋转图像?
Is there a more automated method in InDesign, where it will rotate the image and textframe correctly depending on whether the page is left-hand or right-hand?
推荐答案
这是一个Javascript脚本,您可以根据页面是左手还是右手呼叫:
Here is a javascript script that you can call:
const cs = CoordinateSpaces.pasteboardCoordinates,
ap = AnchorPoint.centerAnchor;
var main = function() {
var doc = app.properties.activeDocument,
gfxs, gfx, pg, par,
mx90 = app.transformationMatrices.add({counterclockwiseRotationAngle:90}),
mx270 = app.transformationMatrices.add({counterclockwiseRotationAngle:270});
if ( !doc ) return;
gfxs = doc.allGraphics;
while ( gfx = gfxs.pop() ) {
par = gfx.parent;
par.locked = false;
pg = par.parentPage;
if (pg instanceof Page) {
par.transform ( cs, ap, pg.side==PageSideOptions.RIGHT_HAND? mx270 : mx90 );
}
}
}
var u;
app.doScript ( "main();", u, u, UndoModes.ENTIRE_SCRIPT );
要进行实时执行,您需要将其与事件监听器结合使用。
For a real time execution you need to use it in combination with an event listener.
这篇关于在InDesign中自动在页面上旋转和放置图像和文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!