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

Read file of a privilege folder with Acrobat reader

Explorer ,
Jul 26, 2021 Jul 26, 2021

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.

 

TOPICS
Create PDFs , General troubleshooting , How to , JavaScript , PDF forms , Standards and accessibility
1.1K
Translate
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 ,
Jul 26, 2021 Jul 26, 2021

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

Translate
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
Explorer ,
Jul 26, 2021 Jul 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-");}

Translate
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 ,
Jul 26, 2021 Jul 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.

Translate
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
Explorer ,
Jul 26, 2021 Jul 26, 2021

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

Translate
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 ,
Jul 26, 2021 Jul 26, 2021
Translate
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
Explorer ,
Jul 27, 2021 Jul 27, 2021

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).

Translate
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 ,
Jul 27, 2021 Jul 27, 2021

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.

Translate
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
Explorer ,
Jul 27, 2021 Jul 27, 2021

Here a picture of the issue I have: 

Tanguy5EDF_0-1627374578656.pngexpand image

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

 

Translate
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 ,
Jul 27, 2021 Jul 27, 2021

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".

Translate
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
Explorer ,
Jul 27, 2021 Jul 27, 2021

How can I mount it as a (virtual) drive to be able to access it ?

Translate
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 ,
Jul 27, 2021 Jul 27, 2021

Ask your network admin or IT department people.

Translate
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
Explorer ,
Jul 27, 2021 Jul 27, 2021
LATEST

Okay thank you very much for your answers

Translate
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