Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!