Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

JavaScript to prompt user to save as PDF

$
0
0

I am making changes with code to the file. I want the user to be prompted to save as a .ai file first. I have that down. Now I am wanting to have the user immediately be prompted to save as a pdf with only the optimize for fast web view option selected. I believe it is an adobe preset of Smallest File Size.

The reason for wanting the prompt is because I want to save the files in 2 different locations.

Here is my code so far.....

var doc = app.activeDocument;
// Save as .ai file 
var fileName = doc.fullName; 
var thisFile = new File(fileName);
var saveFile = thisFile.saveDlg();
doc.saveAs (saveFile);


// Save as .pdf file
var pdfSaveOptions = new PDFSaveOptions(); 
pdfSaveOptions.pDFXStandard=PDFXStandard.PDFXNONE; 
pdfSaveOptions.compatibility = PDFCompatibility.ACROBAT5; 
pdfSaveOptions.preserveEditability = false;  
var pdfFile = new File(fileName); 
doc.saveAs(pdfFile, pdfSaveOptions);

AI CS4 Windows 7 64bit


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>