Copy link to clipboard
Copied
Hi all,
I am struggling to write a script to save the ".ai file" to ".pdf file" in the default path, where it is located like(C drive or D drive ). Kindly help in this concern.
Hi,
Try following snippet. This will save the pdf at the same path where your ai file exists and with the same name as as your ai file.
var _doc = app.activeDocument;
var _name = _doc.name.replace('.ai', '');
var _path = _doc.path;
var _pdfFile = File(_path + '/' + _name + '.pdf');
var saveOpts = new PDFSaveOptions();
saveOpts.preserveEditability = true;
PDFSaveOptions.viewAfterSaving = false;
_doc.saveAs(_pdfFile, saveOpts);
Copy link to clipboard
Copied
Hi,
Try following snippet. This will save the pdf at the same path where your ai file exists and with the same name as as your ai file.
var _doc = app.activeDocument;
var _name = _doc.name.replace('.ai', '');
var _path = _doc.path;
var _pdfFile = File(_path + '/' + _name + '.pdf');
var saveOpts = new PDFSaveOptions();
saveOpts.preserveEditability = true;
PDFSaveOptions.viewAfterSaving = false;
_doc.saveAs(_pdfFile, saveOpts);
Copy link to clipboard
Copied
Thank you so much