View previous topic :: View next topic |
Author |
Message |
aldavhu221
Joined: 13 Apr 2011 Posts: 13
|
Posted: Fri Mar 27, 2015 1:51 am Post subject: Calling Acrobat to display a PDF |
|
|
My Fortran program runs in a CMD window and produces a PDF report.
Currently I give the user the PDF filename and leave it there.
Does anyone know a way of calling ACRORD32.EXE to display the resultant PDF in a regular PC window just before my program terminates?
Can anyone suggest a better way? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Fri Mar 27, 2015 8:22 am Post subject: |
|
|
You might try START_PROCESS@ or START_PPROCESS@. Another possibility is CISSUE@. See FTN95.chm or the online Silverfrost help for details. |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Fri Mar 27, 2015 8:40 am Post subject: |
|
|
This post caught my attention because it could be useful for lots of things, but how is it possible to get the program to automatically search for where the program executable is located (full path) to launch it. Is there a Windows command for that ? |
|
Back to top |
|
|
IanLambley
Joined: 17 Dec 2006 Posts: 490 Location: Sunderland
|
Posted: Fri Mar 27, 2015 1:07 pm Post subject: |
|
|
Try
Code: |
CALL USE_URL@('Myfile.pdf')
|
|
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Fri Mar 27, 2015 3:26 pm Post subject: |
|
|
I use START_PPROCESS@ to display the PDF I create for the user. This way, the program can continue while the PDF is being loaded and displayed.
Code: |
PPNAME = TRIM(OPENED_FILENAME(I))//'.PDF'
return_val = start_pprocess@('explore',TRIM(PPNAME))
|
I call EXPLORE to insure that if the PATH has been mucked with, it will still open the file using the assigned application. It was a bit of a surprise that I needed to do it this way, but then, isn't all of Windows an adventure?
This works for any file for which there is a registered application and OPEN defined. In addition, you can replace "explore" with a specific application if you chose (or need to because of conflicts in the default application).
Bill |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Fri Mar 27, 2015 4:45 pm Post subject: |
|
|
You can put the file in the local folder on somewhere on the PATH environment variable.
If it is on the PATH then there is a Window API for this called SearchPath.
You can find its signature in WIN32API.INS. |
|
Back to top |
|
|
aldavhu221
Joined: 13 Apr 2011 Posts: 13
|
Posted: Sat Mar 28, 2015 3:38 pm Post subject: |
|
|
Thanks for your help.
Bill's suggestion worked fine but one small point: it should be 'explorer' not 'explore'. |
|
Back to top |
|
|
|