Solved

How to run Delphi program with arguments from a pdf document?

Posted on 2006-11-12
7
289 Views
Last Modified: 2007-12-19
I made a .pdf document with several links to my delphi program. The problem is, that each of these links requires different action from my program. So, I am wandering is there any way to run my program with some arguments (integer, string or some other data type) which will help my program to know what to do. And how to run that program with arguments from link?

Is this posibble?

Thank you.
0
Comment
Question by:UrosVidojevic
  • 3
  • 2
  • 2
7 Comments
 
LVL 15

Expert Comment

by:mikelittlewood
ID: 17926914
Do you mean run your delphi application via a desktop shortcut with extra commands? If so then yes.

You can pass parameters to your application via a shortcut, then decode them on main form create by looping through them ( they will be separated by a space in the shortcut and the application knows that each is individual).

for i := 1 to paramcount do
begin

end
0
 
LVL 15

Expert Comment

by:mikelittlewood
ID: 17926918
Note that parameters passed in double quotes will be treated as a single parameter without quotes:
myprog.exe "test string" param2
ParamStr(1)='test string'
ParamStr(2)='param2'

You can then convert to other variable types on load, ie integer
0
 
LVL 7

Author Comment

by:UrosVidojevic
ID: 17926944
I have several hyperlinks in pdf file (which I got by converting doc file with openoffice), these links should contain name of my program and parameters. Each time user clicks on some of links my program should be run with arguments which I gave in hyperlink.

For example:

Link 1 <myprogram.exe, param = "user choosed link 1">

Some text....

Link N <my program.exe, param = "user choosed link n">
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 7

Author Comment

by:UrosVidojevic
ID: 17927179
Ok, now I can make N shortcuts to my program, each containing some parameter, and then point N links in my document to them, but I need better solution:

How to embed information about parameters in hyperlink?
So, each hyperlink should contain name of exe file and parameters.
0
 
LVL 26

Accepted Solution

by:
EddieShipman earned 500 total points
ID: 17938398
In the PDF, you can use Adobe's javascript to do that. You have to have the full Acrobat in order to
build your PDF with the javascript assigned to the hyperlinks.
0
 
LVL 7

Author Comment

by:UrosVidojevic
ID: 17939744
Yes I have full Acrobat 7, can you give me the javascript code to run program MyProgram.exe with some string parameter, and explain briefly how to do that (make that hyperlink)?

Thank you.

U.V.
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 17939850
No, I don't have Acrobat installed. I just know it exists however, let me check the documentation to see if
it realyl can be done and how.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question