Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2006-11-12
7
Medium Priority
?
306 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

604 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