I have been trying doc.saveAs and this.saveAs to save a pdf that is currently open and for which we have used variables to generate the file name. The code looks like this
var filePath ="/C/Program Files/Adobe/Acrobat 8.0/Acrobat/Javascripts/other Javascripts/";
doc.saveAS(filePath + fileName + ".pdf");
But both options generate error messages. What am I missing here?
Kev
I have since researched this and found it's something to do with privileges but even then my code doesn't work. The code is now
function displaySettings(fileName,stage,industry)
{
var finalsettings = app.alert("Stage: " + stage + "\n" +"Industry: " + industry + "\n"+ "File name: " + fileName + ".pdf\n"+"Do you want to continue?",2,2,"Submit settings");
if(finalsettings==4)
{
app.alert("You said OK");
//var filePath ="/C/Program Files/Adobe/Acrobat 8.0/Acrobat/Javascripts/other Javascripts/";
var filePath ="/C/Test/";
path=filePath
mySaveAs = app.trustPropagatorFunction(function(doc,path)
{
app.beginPriv();
doc.saveAs(path);
app.endPriv();
})
myTrustedSpecialTaskFunc = app.trustedFunction(function(doc,path)
{
Privileged and/or non-privileged code above
app.beginPriv();
mySaveAs(doc,path);
app.endPriv();
Privileged and/or non-privileged code below
});
}
else {
app.alert("You said No");
}
}
Any help would be welcome. BTW it's a js file in the applications folder.
Kev
/Width 500
/BitsPerComponent 8
/Name /I0
/Height 375
/F
/FS /URL
/F (http://www.nikon.co.in/products/1363/d05571847a/S3000_BL_front34l_lo_i.jpg)
/Subtype /Image
/FFilter /DCTDecode
/Length 0
/Type /XObject
/ColorSpace /DeviceRGB
stream
endstream
endobj
but after saving, images are not embeded perminently.
how can i save images in PDF file after click on saving button.