• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
InDesign problems placing items on spreads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

InDesign problems placing items on spreads


  • Subject: InDesign problems placing items on spreads
  • From: RJay Hansen <email@hidden>
  • Date: Tue, 07 Feb 2017 09:07:07 -0600

I’ve got a script for placing PDFs on InDesign pages. It has an InDesign dialog that allows the user to specify which pages to place from a multi-page pdf (1 page, a range or all of them) and allows the user to specify whether the InDesign document should be set up as facing pages or not as well as whether to override the PDF page size and/or reduce or enlarge the PDF pages when placed.

The script works as expected unless the user chooses facing pages as an option. If facing pages is chosen, after page one, all subsequent pages are placed on the even (left hand) pages of the document. And the spread’s odd page is also placed on the page’s even page, e.g. PDF page 2 is correctly placed on page 2 of the InDesign doc, then PDF page 3 is placed on top of PDF page 2 on page 2 of the InDesign doc. And page 3 of the InDesign doc is left blank. It continues in the fashion throughout. So page 1 gets a PDF place on it but all the rest of the odd pages are blank. And all the even pages have two PDFs placed on them, one on top of the other.

The script specifically iterates through the pages telling each page to create a frame and place the corresponding PDF page in that frame. So I can’t figure out why it’s placing the odd pages on the facing even page.

Here’s the part of my script that actually handles creating the frames and placing the PDFs. 

--finally we'll place all the pages in the document
else
if withBleed then
set PDF crop of PDF place preferences to crop bleed
else
set PDF crop of PDF place preferences to crop trim
end if
repeat pdfPageCount times
set page number of PDF place preferences to pageCounter
get page number of PDF place preferences


tell page currentPage of myDoc
if withBleed then
set bleedBounds to {-0.125, -0.125, (docHeight + 0.125), (docWidth + 0.125)}
set pdfframe to make rectangle with properties {geometric bounds:bleedBounds}
set placedPDF to place workingFile on pdfframe
set placedPDF to item 1 of placedPDF
else
set pageBounds to {0, 0, docHeight, docWidth}
set pdfframe to make rectangle with properties {geometric bounds:pageBounds}
set placedPDF to place workingFile on pdfframe 
set placedPDF to item 1 of placedPDF
end if


--scale and center pdf if scaling was chosen
tell placedPDF
set horizontal scale of it to scaleTo
set vertical scale of it to scaleTo
end tell
fit placedPDF given center content
end tell


set pageCounter to pageCounter + 1
set currentPage to currentPage + 1
end repeat
end if

I’m happy to post the entire script if that will help someone figure out where the problem lies. It’s a pretty large script though (over 100K) so I didn’t want to post it all here if it’s not necessary.

Thanks for any ideas,
RJay

http://www.rocketjam.com

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: InDesign problems placing items on spreads
      • From: Steve Mills <email@hidden>
  • Prev by Date: Re: Numbers Daylight Savings Bug Still Active?
  • Next by Date: Re: Scripting Numbers a Little More – Extracting Data into an Array
  • Previous by thread: Re: Scripting Additions – Broken Bundles?
  • Next by thread: Re: InDesign problems placing items on spreads
  • Index(es):
    • Date
    • Thread