Skip to main content
Participant
October 20, 2020
Question

Save PDF Silently on network drive and file name construct based on Invoice No and Customer Name

  • October 20, 2020
  • 1 reply
  • 248 views

I am trying to save a file on pre-Print ( I will change this to PostSign event as currently theres no dongle with me to test ) event. I am failed to save file silently or in foreground!!. I have written following code.  I am requesting you to kindly help me to understand where I am making mistake. I will appreciate your help in this manner greatly.  For your information I am using Adobe Live Cycle Designer to make Adobe print based pdf form for SAP Applications. 

 

Code :

I have put Config.js in the /Reader/.../Javascripts directory with below code:

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
});

I have written below code in Javascript Editor for Live cycle designer in under prePrint

data.master_page.Page1.#subform[6]::prePrint - (JavaScript, client)
//app.execMenuItem("SaveAs");
var myFileName = data.master_page.Page1.Address_details.Rec_del_add.SO_NAME1 + 
                 " - " + 
                 data.master_page.Page1.Address_details.Inv_dtls.VBELN +
                 .pdf";                 
// add folder name
myFileName = "/c/Users/archit.p/Desktop/Sanathan E-Invoice/From Form/" + myFileName;
myTrustedSpecialTaskFunc(this, myFileName);
this.closeDoc() ;

I event tried to by putting app.alert to see is there any value in myFileName ? but alert is also not working. 

 

only

app.executeMenueItem(SaveAs);

is working but this is not serving my purpose.  

 

Thanking you!

Best Regards

Naim

 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
October 20, 2020