Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

172
Vistas
Shapes aren't drawn on the good page when the document setup is 'facing page' in InDesign (CEP/JavaScript)

I am creating an InDesign plugin where one of the features is to draw shapes on a given page.

I get a drawing from the backend with the page number on which it should be drawn.

For this, I do : app.activeDocument.pages[index] to get the page I want.

Unfortunately, I realized that this technique only works when the pages are not facing each other like this :

enter image description here

When the pages are facing each other like this :

enter image description here

, the shapes on page 3 will be drawn on page 2 instead of on page 3.

Here, the drawings are on the right page :

enter image description here

But here, the rectangle isn't on the right page :

enter image description here

I also tried to draw the shape in a raw way by doing app.activeDocument.spreads[indexSpread].pages[1], which should logically write the note on the 2nd page of the board in question except that it is always drawn on the 1st page of the board.

Here is my code to draw the rectangle :

var doc = app.activeDocument;
var page = doc.pages[pageIndex-1];
var myRectangle = page.rectangles.add();
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

To address pages inside a spread use the page origin coordinates:

app.activeDocument.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;

var doc = app.activeDocument;
var page = doc.spreads[indexSpread].pages[1];
var myRectangle = page.rectangles.add();
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda