PDA

View Full Version : PDF



Bruce
08-26-2002, 06:44 PM
I have a project that has 31 PDF files. I have a List Box Oject and under it's properties/on Selection Changed I have:

%SlectedIndex%=ListBoxObject[Lessions].GetSelected
%ItemData% = ListBoxObject[Lessions].GetItemData (%SelectedIndex%)
File.Open (open, "%ItemData%")

How would I use the AcroRd32.exe that would be on the CD to view my PDFs with out the end user needing to load Acrobat on to their system?

Derek
08-26-2002, 10:33 PM
Hi Bruce -

Here's what yu need:

You gotta add extra info into the %ItemData% The problem this causes, is the extra info gets 'used' as part of the 'execution'
So, the first part of %ItemData% is gonna be the address of the AcroRd32.exe file followed by the address of the pdf file
For now, we're gonna make it all one long line:

Item 1::%address%\AcroRd32.exe^%address%\filename.pdf

The reason for ^ in the middle is to seperate the two parts. You can't put another :: in there coz %ItemData% is supposed to fall between :: and :: OR :: and ;; (if that makes sense) so it stops when it gets to the second ::

With all of it included in %ItemData% we can now break it up into two parts and get each part seperately for the execution. Before we can do this, however, we need a common delimiter so we gotta change ^ back to :: (this is allowed now because since we have already got %ItemData% we can play around with it) so to change it we use:

%NewString%=String.Replace (changing ^ for ::)

<font color=green>
<IR_ACTIONS_LIST>
<Action name="Replace">
<Type>60</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%NewString%</Variable>
<SearchIn>%ItemData%</SearchIn>
<SearchFor>^</SearchFor>
<ReplaceWith>::</ReplaceWith>
<CaseSensitive>1</CaseSensitive>
</Action>
</IR_ACTIONS_LIST>
</font color=green>

Now we need to pull out the first part using:

%NewString2%=String.GetDelimitedString[%NewString% , :: , 0]

<font color=green>
<IR_ACTIONS_LIST>
<Action name="Get Delimited String">
<Type>64</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%NewString2%</Variable>
<Source>%NewString%</Source>
<Delimiter>::</Delimiter>
<ItemIndex>0</ItemIndex>
</Action>
</IR_ACTIONS_LIST>
</font color=green>

Then the second part:

%NewString3%=String.GetDelimitedString[%NewString% , :: , 1]

<font color=green>
<IR_ACTIONS_LIST>
<Action name="Get Delimited String">
<Type>64</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%NewString3%</Variable>
<Source>%NewString%</Source>
<Delimiter>::</Delimiter>
<ItemIndex>1</ItemIndex>
</Action>
</IR_ACTIONS_LIST>
</font color=green>

And then execute the file using:

File.Execute[%NewString2% , %NewString3%]

<font color=green>
<IR_ACTIONS_LIST>
<Action name="Execute">
<Type>8</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<FileName>%NewString2%</FileName>
<CommandLine>%NewString3%</CommandLine>
<WorkingDir/>
<RunMode>0</RunMode>
<WaitForReturn>0</WaitForReturn>
</Action>
</IR_ACTIONS_LIST>
</font color=green>

Bruce
08-30-2002, 12:23 PM
Ok, I'll try that out thanks...What if I only had one PDF and did not have a List Box just a button to view the PDF. BTW I would still want to use the Acrobat.exe that was on the CD.

Thaks my man!

Bruce
08-30-2002, 12:50 PM
Hey Derek-
I'm really lost here, when you say: "we're gonna make it all one long line:"
Are you saying:
Item 1::%address%\AcroRd32.exe^%address%\filename.pdf and %NewString%=String.Replace
and %NewString2%=String.GetDelimitedString[%NewString% , :: , 0]
and %NewString3%=String.GetDelimitedString[%NewString% , :: , 1]
and File.Execute[%NewString2% , %NewString3%] all go together???
My %ItemData% line looks like this:
01 The Nature of God::%SrcDir%\Lessions\01 The Nature of God.pdf thirty one times over (different pdfs). Do I need to put your corrections in 31 times?

Derek
08-30-2002, 01:10 PM
Hey Bruce - it can get a little confusing, I know. I tried to keep it in some sort of clear oder by having the seperate actions in bold with all info in normal formatting. All the green text is actions yu can copy and paste straight into AMS in appropriate places. You may need to go into it then and adjust it to suit - like the %address%

Have a go at pasting in the Actions in AMS to see how it's working out. I guess if yu have 31 in yur list box ... then yur gonna have to make the changes 31 times (one of the downsides to changing yur mind half way thru /ubbthreads/images/icons/frown.gif).

You can load the list from a text file at runtime with a few adjustments:

this post (http://www.indigorose.com/ubbthreads/showthreaded.php?Cat=&amp;Board=UBB2&amp;Number=10193&amp;page =0&amp;view=collapsed&amp;sb=5&amp;o=0) may give yu some idea of how to set that up /ubbthreads/images/icons/smile.gif

Bruce
08-30-2002, 04:24 PM
Thanks Derek I'll give it a try!

Bruce
08-30-2002, 05:28 PM
What if I only had one PDF and did not have a List Box just a button to view the PDF. BTW I would still want to use the Acrobat.exe that was on the CD.

Derek
08-30-2002, 08:14 PM
Then on MouseClick yu could use File.Execute pointing to the AcroRd32.exe and have the address of the pdf file as the argument

Bruce
08-31-2002, 03:28 PM
You are the poop buddy! LOL

Thanks

Bruce

Eric
09-01-2002, 10:27 PM
RE:
Then on MouseClick yu could use File.Execute pointing to the AcroRd32.exe and have the address of the pdf file as the argument
----------------------------------------------------------

Hey Derek:

Thanks...this just gave me an idea for dealing with a Flash Projector .exe file :-) I assume the same action would work.

Eric

StandardMan
09-02-2002, 07:33 PM
I do wish the "help" section of AMS4.0 was more robust. It is very topical in content.

Is there anyway to get better documentation on this application with more examples (preferable with screenshots)?

Thank you in advance

Bruce
09-03-2002, 08:02 PM
Derek- OH MY GOD! WHAT A PITA! I'm just not getting it!!! First it might help to understand... What type of programming is this???? Shed your all knowing light on this will ya? LOL.

Ok I feel better, here is one of the 31 PDFs I have in my "list" how should it read if I'm using the Reader\AcroRd.exe on the CD?

01 The Nature of God::%SrcDir%\Lessions\01 The Nature of God.pdf

IndigoRose... we REALLY need to gear something toward the true beginner this can't be another 3.0.

Luv-in you!

Oh, thanks Derek!

Bruce

Derek
09-04-2002, 05:01 PM
Export the page with the list box to a PG4 file and attach it to a post (just the page ... dont need any other files). I'll take a look at it. (Or email it to me if you don't want to post it in public.)

nagad
10-01-2002, 11:38 PM
Hi, Bruce

I was reading about list box object when I saw what you wrote about the AcroRd32.exe being on a CD. Can you, please explain how you put this program on a CD without installing it. I tried to see if this is possible by copying the AcroRd32.exe to a different folder and drive, and run it from there. I did opened, but without "file", "edit", "document", "tools", etc. This question has nothing to do with your question about PDF and AMS4. I am just curious. Thank you.

Bruce
10-02-2002, 12:37 AM
Hey nagad-
Sure! You place a folder called Acrobat with all your Acrobat files in it. The AcroRd32.exe must be in the Acrobat folder not in any other folder that resides within the Acrobat folder. LOL does that make sence? Ok… now add this to your list box’s actions (assuming that your files are in a file called Lessons). I didn't write this but Derek did. Very, very kind of him don't you think? Give it a try.

<IR_ACTIONS_LIST>
<Action name="Get Selected">
<Type>126</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<TargetListBox>Lessions</TargetListBox>
<Variable>%SelectedIndex%</Variable>
<VariableDelimiter>;;</VariableDelimiter>
</Action>
<Action name="Get Item Data">
<Type>121</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<TargetListBox>Lessions</TargetListBox>
<Index>%SelectedIndex%</Index>
<Variable>%ItemData%</Variable>
</Action>
<Action name="Replace">
<Type>60</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%NewString%</Variable>
<SearchIn>%ItemData%</SearchIn>
<SearchFor>^</SearchFor>
<ReplaceWith>::</ReplaceWith>
<CaseSensitive>1</CaseSensitive>
</Action>
<Action name="Get Delimited String">
<Type>64</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%NewString2%</Variable>
<Source>%NewString%</Source>
<Delimiter>::</Delimiter>
<ItemIndex>0</ItemIndex>
</Action>
<Action name="Get Delimited String">
<Type>64</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%NewString3%</Variable>
<Source>%NewString%</Source>
<Delimiter>::</Delimiter>
<ItemIndex>1</ItemIndex>
</Action>
<Action name="Execute">
<Type>8</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<FileName>%NewString2%</FileName>
<CommandLine>%NewString3%</CommandLine>
<WorkingDir/>
<RunMode>0</RunMode>
<WaitForReturn>0</WaitForReturn>
</Action>
</IR_ACTIONS_LIST>

nagad
10-02-2002, 03:45 AM
Hi Bruce

Thanks a lot

Derek
10-02-2002, 08:39 AM
It should be noted that those pasted Actions are unlikely to work on their own because they are tied to other Objects/Files

Bruce
10-02-2002, 02:14 PM
This is true. Also I forgot the most important part! Tha list, it would look somthing like this:
The name of your file::%SrcDir%\Acrobat\AcroRd32.exe^%SrcDir%\the folder you file is in\the name of your file.pdf

Hey Derek, love the shirt!