Solved

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

Posted on 2006-11-12
7
301 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 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

691 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