Skip to main content
Inspiring
September 3, 2023
Answered

Open jpg file

  • September 3, 2023
  • 1 reply
  • 893 views

Hi
please, can someone help me to solve this problem?
I have a folder where I have a folder where there are several jpg files.
these files are named
ONE.jpg
TWO.jpg
THREE.jpg
etc.
In a PDF file I created a drop-down menu called "PHOTO" with the list of file names (ONE.jpg; TWO.jpg; THREE.jpg; etc.)
I would like to create a button that opens the jpg file selected from the drop down menu
The path to the card containing the jpg files is
C:\Users\Name Surname\Documents\AUXILIA\AGENCIES\PHOTOS
I tried with the app.openDoc function but it doesn't work (only works with PDF files)
app.openDoc("C:/Users/Name Surname/Documents/AUXILIA/AGENCIES/PHOTO/"+this.getField("PHOTO").value);
Is there a function to solve this problem?
Thank you

This topic has been closed for replies.
Correct answer try67

Try this:

app.openDoc({cPath: "/C/Users/Name Surname/Documents/AUXILIA/AGENCIES/PHOTO/"+this.getField("PHOTO").valueAsString, bUseConv: true});

 

Note this will only work in Acrobat, not in Reader. And of course the files will have to be located in that exact location for it to work...

1 reply

try67
try67Correct answer
Community Expert
September 4, 2023

Try this:

app.openDoc({cPath: "/C/Users/Name Surname/Documents/AUXILIA/AGENCIES/PHOTO/"+this.getField("PHOTO").valueAsString, bUseConv: true});

 

Note this will only work in Acrobat, not in Reader. And of course the files will have to be located in that exact location for it to work...

ENE5CD9Author
Inspiring
September 4, 2023

A thousand thanks
so you can't open it with the windows paint program, but only with Acrobat?

try67
Community Expert
September 4, 2023

Not unless the file is attached to the PDF, no.