Skip to main content
Known Participant
July 26, 2021
Question

Read file of a privilege folder with Acrobat reader

  • July 26, 2021
  • 1 reply
  • 1330 views

Hello everyone,

 

I'm trying to read files and put values from these files inside my pdf form. These files are on a network of my company. I know this is not a secure way to do it, but it is just a first version of my form. It works perfectly with acrobat standard version. However I'v got an issue with the Reader version.

I put all files in preferences > security (enhanced) . However, on Acrobat Reader, I can't add a folder from a network. So, I used the local host but it doosn't work, it dosen't read my files. 

If anyone have the solution in this case I'm listening.

Thank you.

 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
July 26, 2021

How are you reading the file, exactly? Share your code, please.

Known Participant
July 26, 2021

Here is how I read my file, and you have the beginning of my code :

var oStream = util.readFileIntoStream("/win-master.hsa.snecma/safrants/SafranTS_Temporary/TEST_IT/cale_compensation_L1.json");
var strJSON = util.stringFromStream(oStream);
var oData = eval("("+strJSON+")");
var lb = this.getField("epaisseur_D1M");

 

if ( event.value >= 1.11 && event.value < 1.139){
lb.clearItems();
lb.insertItemAt(oData['1,14']['epaisseur']);
lb.insertItemAt(" -cale-");}

Known Participant
July 26, 2021

You need to place the readFileIntoStream method into a trusted function in a privileged context (such as an app-level script), and then it should work. I think that should also apply when used in Acrobat Standard, though.


How can I put this function into an app-level script ? Can you help me on this point please ? Thank you very much in advance