These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

saving new active pdf file

umakant
Registered: Dec 28 2006
Posts: 4

i want to save the new active pdf file. currently i am using the following code
 
app.addMenuItem({cName:"-", cParent:"Help", cExec:" "});
app.addMenuItem({cName:"Upload Loan Documents", cParent:"Help",
cExec:"app.launchURL('http://localhost/sumitomo/uploadloandocs.aspx');Browse();"});
 
function Browse()
{
var cBrRslt = "Not Set";
try {
app.beginPriv();
var cRtn = app.browseForDoc(true);
app.endPriv();
if(cRtn != null)
{
cBrRslt = "File System: " + cRtn.cFS + "\nPath: " + cRtn.cPath;
cBrRslt += "\nURL: " + cRtn.cURL;
}
else
cBrRslt = "File Browse Canceled";
}
catch(e)
{
cBrRslt = e.toString();
}
app.alert( cBrRslt, 3);
}
 
i placed the above code in config.js file
 
by this code follwoing thing happens
 
the shortcut of the file gets saved which can be viewed from recent acess documents and when i try to click that file it shows the follwoing message
 
"windows is searching the file click the file to locate the file" and it does not saves the file.
can u please tell what the problem is?
 
how can we save the file

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I'm confused, there's nothing in the code for saving a file, only for opening a file. Here are two general observations about the script.

1. What's the point of opening up a web page? This doesn't seem to server a purpose.

2. beginPriv and endPriv can only be used in the context of a privileged function, which you'll need to run the app.browseForDoc function.

rename the "Browse" function to "Browse_def" and add the following line of code.

var Browse = app.trustedFunction(Browse_def);

Thom Parker
WindJack Solutions
[url=http://www.windjack.com]www.windjack.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://partners.adobe.com/public/developer/en/acrobat/sdk/
pdf/javascript/AcroJS.pdf]Acrobat JavaScript Reference[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script