Article View: adobe.scripting.indesign
Article #17484-1708 error when placing pdf pages
From: Matt Riley
Date: Fri, 06 Jun 2003 03:19
Date: Fri, 06 Jun 2003 03:19
73 lines
3753 bytes
3753 bytes
I have a script (which I got most of from here) that places all of the pages of a multi-page pdf into a new or existing InDesign file. I've been using this script in production for some time now. Recently, however, when I tried to use it to import a 16 page pdf, it will only import 13 pages before giving me a -1708 error with the description that it failed to open the pdf file.
I don't think there is anything wrong with the pdf. I can delete pages from it, resave it with Acrobat and then import the last pages just fine. It's not taking any longer than usual for the pages to import - it just dies. I tried running the script from ID2's palette, script editor and even the script menu, all with the same result. I'm stuck and need some help.
InDesign 2.0.2 on OS X 10.2.6. Here is the script (maybe there is a better way to write it to avoid this problem?):
--------------------------------
-- Get the path to the PDF file you are importing
tell me to set thePDF to choose file with prompt �
"Pick a multi-page pdf to import:"
--How many pages to create and import
display dialog "Enter the number of pages to import." default answer 1
set pageCount to text returned of the result
display dialog "Is the pdf orientation tall or wide?" buttons {" Tall ", " Wide "} default button " Wide " with icon 1
if button returned of the result is " Tall " then
set pageOrientation to "tall"
else
set pageOrientation to "wide"
end if
tell application "InDesign 2.0.2"
with timeout of 1200 seconds
--Create a new document
set newDoc to make document
--setup dimensions for new document
set horizontal measurement units of view preferences of newDoc to inches
set vertical measurement units of view preferences of newDoc to inches
set page width of document preferences of newDoc to 22.25
set page height of document preferences of newDoc to 22
--let's see it!
zoom window 1 of newDoc given fit page
--Add as many pages to the document as there are pages in the PDF
set pages per document of document preferences of newDoc to (pageCount as number)
if pageOrientation is "tall" then
set page orientation of document preferences of newDoc to portrait
else
set page orientation of document preferences of newDoc to landscape
end if
--iterate through every page in the pdf
repeat with i from 1 to pageCount
--tell InDesign which page of the pdf to place
set page number of PDF place preferences to i
--set the pdf import options
set PDF crop of PDF place preferences to crop media
set preserve halftone of PDF place preferences to false
set transparent background of PDF place preferences to false
--and place the file on the right page
place thePDF on page i of newDoc
end repeat
--set page width for plate output
set page width of document preferences of newDoc to 25.694
end timeout
end tell
say "P D F pages have been successfully imported" using "Victoria"
--------------------------------
Thanks for any help you can offer.
-Matt
Technical Details
Message-ID:
<1de96d8e.-1@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,66e862b42340a21,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-06-05 20:37:51 PST From: "Matt Riley" <mattriley@mac.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: -1708 error when placing pdf pages Message-ID: <1de96d8e.-1@WebX.la2eafNXanI> Date: Thu, 5 Jun 2003 20:19:20 -0700 Lines: 88 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit