PDA

View Full Version : PDF's confusin


teva
03-18-2004, 08:12 AM
1.
Is it possible to automaticly load Acrobat Reader when selecting page.jump ?
I have about 300 pdf document on one page and when loading first, it takes some time to load acrobat. So i was thinking to load acrobat, when user jumps to this page and when he openes first pdf, acrobat takes focus and loads pdf. It would be much quicker.


2.
Is it possible to add command, that would open all PDF document into internet explorer? Sure it would take some time, but it would be very easy to jump thru pdf's with back and forward button in browser.
Or, if anybody has some idea how to ease up PDF browsing, please let me know.

3.
How about if i want to add a command, that would copy from CD all the PDF's into users temp dir on local disk and then load files from there. When closing media project, temp dir would be erased.

hope ya all get what i mean.

tnx a bunch for any help

teva

csd214
03-22-2004, 04:40 AM
You haven’t got any answer so far, so I’ll try. Opening PDFs is of interest for my coming project, but I’m new to AMS, so read my answers with care …

1. Automatically load Acrobat Reader (without opening a document)
[Page1, Preload]
if not PDF_loaded then
Acro_path = "D:\\Program Files\\Adobe\\Acrobat 5.0\\Reader\\"
File.Run(Acro_path.."AcroRd32.exe", "", "", SW_MINIMIZE, false);
PDF_loaded = true
end
[On Show]
while PDF_handle == nil do
Application.Sleep(500); -- seems to be necessary
PDF_handle = GethWin("Acrobat Reader")
end
Window.SetOrder(Application.GetWndHandle(), HWND_TOP);


The AMS app lost the focus until I added the SetOrder action.

Page 3
I wanted to open a PDF document here, but I wanted the window to be positioned at upper left corner with a small window size. After a lot of struggle, I ended up with this:

[On Show]
File.Open("AutoPlay\\Docs\\MyDoc.pdf", "", SW_SHOWNORMAL);
PDF_loaded = true
PDF_handle = GethWin("Acrobat Reader");
while PDF_handle == nil do
Application.Sleep(500);
PDF_handle = GethWin("Acrobat Reader")
end
Window.Restore(PDF_handle);

Window.SetPos(PDF_handle, 0, 0);
Window.SetSize(PDF_handle, 630, 425);

[On Close]
PDF_handle = GethWin("Acrobat Reader");
Window.Restore(PDF_handle);
Window.Minimize(PDF_handle)
Window.SetOrder(Application.GetWndHandle(), HWND_TOP);

[Project:On Shutdown]
PDFhandle = GethWin("Acrobat Reader")
if PDFhandle ~= nil then
Window.Close(PDFhandle, CLOSEWND_SENDMESSAGE);
end

QUESTION
But how to set the desired directory when using File, Open in AR? To declare the "WorkingFolder” is of no help.

PROBLEMS?
On the way I had to struggle with some errors:
- “Application.Exit()” worked as Windows shut down (due to errors in my script)
- Label links were suddenly ‘dead’ (at run time). Buttons with exactly the same action (Page_Navigate) did always work. If I closed the minimized AR app, the labels ‘waked up’. After rebooting I can’t recreate this issue.

My problems taught me to use the Debug tools! Recommended!!

2. Open all PDF document into internet explorer
You want “to jump thru pdf's with back and forward button in browser”. Do you think this is user-friendly (300 docs)? I should propose a categorized list in AMS.

3. Copy files
This should be a trivial task. Give it a try (the Help doc is really good with examples to every action).

I have maybe given you a partial answer? Good luck.