Silverfrost Forums

Welcome to our forums

Calling Acrobat to display a PDF

27 Mar 2015 12:51 #16006

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?

27 Mar 2015 7:22 #16008

You might try START_PROCESS@ or START_PPROCESS@. Another possibility is CISSUE@. See FTN95.chm or the online Silverfrost help for details.

27 Mar 2015 12:07 #16010

Try

      CALL USE_URL@('Myfile.pdf')
27 Mar 2015 2:26 #16012

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.

	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

27 Mar 2015 3:45 #16013

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.

28 Mar 2015 2:38 #16022

Thanks for your help.

Bill's suggestion worked fine but one small point: it should be 'explorer' not 'explore'.

Please login to reply.