Read file of a privilege folder with Acrobat reader
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
How are you reading the file, exactly? Share your code, please.
Copy link to clipboard
Copied
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-");}
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Start by reading these tutorials:
https://acrobatusers.com/tutorials/trust-and-privilege-in-acrobat-scripts
https://acrobatusers.com/tutorials/using_trusted_functions
Copy link to clipboard
Copied
Okay thank you very much, I just read it, but I 'm thinking I can't add privilege function due to the fact that it needs to work on every computer of my company. Moreover, the issue is only for Reader on the Standard version there is no problem to read file on network because I can select the folder where there are files on it (not the case on Reader).
Copy link to clipboard
Copied
Not sure what you mean by "I can select the folder where there are files on it"...
If you can't install a script on the local machine then it won't work, though.
Copy link to clipboard
Copied
Here a picture of the issue I have:
As you can see, I am not able to see any folder on the network of the company. So, I am not able add any folder as privilege context and so to read my files
Copy link to clipboard
Copied
Ah, you're talking about this dialog... I can't help you with that. Maybe you need to mount it as a (virtual) drive to be able to access it. It's possible only local files can be considered "trusted".
Copy link to clipboard
Copied
How can I mount it as a (virtual) drive to be able to access it ?
Copy link to clipboard
Copied
Ask your network admin or IT department people.
Copy link to clipboard
Copied
Okay thank you very much for your answers

