🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting
Article #28

Unable to export pdf, security settings and compatibility don't work

#28
From: William_Hambleton
Date: Thu, 02 Sep 2004 05:23
42 lines
2840 bytes
Alright, this is driving me batty. All I want to do is applescript exporting a pdf. I keep encountering 3 problems that don't seem to be answered in the guides. Here is the relevant script:

tell application "InDesign CS"
	--configure pdf export settings
	tell PDF export preferences
		--general settings
		set acrobat compatibility to acrobat 5
		--other pdf settings (compression, etc)
		--security settings
		set use security to true
		set change security password to "SHPS"
		set disallow extraction for accessibility to false
		set disallow document assembly to false
		set disallow form fill in to false
		set disallow notes to true --turn off commenting
		set disallow copying to true
		set disallow changing to true
	end tell
	--export the active document as pdf
	tell active document
		set docName to full name & ".pdf"
		export myDoc to file docName format "Adobe PDF"
	end tell
	--close the active document
	close active document
end tell

First, when you set acrobat compatibility to 5, it doesn't work. When I open the resulting pdf, it says can be opened with 3. Yet when I export manually it says it can be opened with 5 - like it should.

Second, the security settings don't seem to work. I can set disallow copying to true but that turns off extraction for compatibility and setting that to false will not turn it on. Other security settings are equally baffling. I cannot figure how to have all changes not allowed, commenting not allowed but still have filling in of form fields allowed. Again, this all works when you do it manually.

Finally, the line

export myDoc to file docName format "Adobe PDF"

should export the pdf to the path/filename stored in docName. Instead I get this error:

InDesign CS got an error: Can't make some data into the expected type.

The only way I can get the export line to work is to use export to file and manually enter the path and file name followed by the format. In the scripting guide it just says export to, without file. I get an error every time I try it like that, even when I manually enter the location. Any help would be greatly appreciated.

w
Technical Details
Message-ID: <3bb5bd67.-1@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!news.cambrium.nl!news.cambrium.nl!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!webx

Show Full Headers
Complete Article Headers
X-Google-Thread: 109719,48ddb6b233a7434b,start
X-Google-Attributes: gid109719,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: William_Hambleton@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!news.cambrium.nl!news.cambrium.nl!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.scripting
Subject: Unable to export pdf, security settings and compatibility don't work
Message-ID: <3bb5bd67.-1@webx.la2eafNXanI>
Date: Wed, 1 Sep 2004 22:23:46 -0700
Lines: 56
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit