open file when published to both HTML and EXE

gs_ek
gs_ek Community Member Posts: 1
Hello all,

I did a lot of searching and testing could not seem to find a solution to my problem:

I need to be able to open PDF files from within the Lectora (version 2008) title. When published to HTML the PDF should always open in a new window and never replace the main content window. When published as an EXE the PDF should simply open, but opening in a browser window would be acceptable as well.



My solution was to attach an action that contains a conditional to the button that launches the PDF (this should also work for any other type of embedded file).



The default On Click that is built into the button properties is left blank.



I attached an Action that is built as follows:

General Tab:

On Mouse Click

Launch a program/document

Use attached file

[pdf file selected in the list]



Condition Tab:

Perform action if TRUE

Browser Type Contains "Lec"



Else Tab:

If the conditions are not met

GoTo Web Address

[file name of the pdf chosen in the list on the General tab, no path, just the name ie. 'Intro.pdf']

Open in new window



The combination of the General, Condition , and Else tabs allows me to open the exact same document when the project is published as either HTML or EXE with one low-maintenance button.



ENJOY!Hello all,

I did a lot of searching and testing could not seem to find a solution to my problem:

I need to be able to open PDF files from within the Lectora (version 2008) title. When published to HTML the PDF should always open in a new window and never replace the main content window. When published as an EXE the PDF should simply open, but opening in a browser window would be acceptable as well.



My solution was to attach an action that contains a conditional to the button that launches the PDF (this should also work for any other type of embedded file).



The default On Click that is built into the button properties is left blank.



I attached an Action that is built as follows:

General Tab:

On Mouse Click

Launch a program/document

Use attached file

[pdf file selected in the list]



Condition Tab:

Perform action if TRUE

Browser Type Contains "Lec"



Else Tab:

If the conditions are not met

GoTo Web Address

[file name of the pdf chosen in the list on the General tab, no path, just the name ie. 'Intro.pdf']

Open in new window



The combination of the General, Condition , and Else tabs allows me to open the exact same document when the project is published as either HTML or EXE with one low-maintenance button.



ENJOY!