Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
Çağla
Discoverer

Summary : Pdf Viewing with Password Control


Steps :


1. Go to Tcode : SFP

2. Create an Interface


 

3.In the interface, the desired password type is added to the import parameter. - Lv_password



 

4. Then this data is used in the form.


5. Go to Layout and Create a text-field .Then bind lv_password.



 

6. Go to the Initialize event of DATA as shown below



 

Code :


data::initialize - (JavaScript, client)


var password = '';
var lv_pass = '';
var passportQuery = false;


lv_pass = USTBOSLUK.TextField2;                                       // Holds the password given in encoding


password = app.response("Enter password","title","",true);  // Holds the value entered from the popup


while( passportQuery == false ){
if (password == lv_pass.rawValue)
{
xfa.host.messageBox("Right password","You Know right",3,0);
passportQuery = true;
}
else
{
app.alert("Wrong password.You entered:"+password);


password = app.response("Enter password","title","",true);


passportQuery = false;
}
}


 

7. Execute :




  • Fill the import parameters when calling the form.

  • Fillable    = 'N'  Interactive form? - Interactive Form Without Additional Usage Rights

  • Dynamic = 'X'   Dynamic Form ? - Dynamic Form






 

-->It was not opened because the password entered in the import parameter and the password entered from the popup were not the same.


--> The popup screen will remain open until the password given in the coding matches the password entered from the popup on the screen.


If the passwords match, the PDF will be displayed.




Advantages ;




  • When dynamically calling Adobeform in your code, the password given and the password your user tries must match.

  • The password is not given as hardcode.

2 Comments