• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Oct 20, 2020 Oct 20, 2020

Copy link to clipboard

Copied

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

 

TOPICS
How to , PDF forms , PDF Pack , Share or review PDFs , View PDF , Windows

Views

163

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 20, 2020 Oct 20, 2020

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines