Page 1 of 1

PDF Plugin problem

PostPosted: Fri Jun 11, 2004 8:11 am
by sunscreen202
Here's the problem. We have Page A listing links to PDF files that if clicked will open the PDF plugin in a rectangle on Page B. Running the app and clicking on the first file works beautifully. You can then on Page B click a 'Return to page' button, which takes you back to page A. If however you select a SECOND PDF file, you are taken to Page B but it still displays the FIRST PDF file opened! Somehow there's a refresh problem or something, but I'm stumped. Any ideas?

PDF Plugin problem

PostPosted: Fri Jun 11, 2004 8:57 am
by Sam Cox
Hi sunscreen202,

Please post a reasonable facsimile of the code you are using to 1) click on a file and display the PDF in Page B's rectangle, 2) the Page Entry and Exit code (if any) for pages A and B, and 3) the "Return to page" button on Page B. I find it much easier to debug code than descriptions.

P.S., what version of Adobe's PDF reader are you using?

(Edited by Sam Cox at 4:58 am on June 11, 2004)

PDF Plugin problem

PostPosted: Fri Jun 11, 2004 9:25 am
by sunscreen202
Thanks for the offer to help Sam. I'm an amateur, so it's hardly 'code'.

On Page A (called 'Databases'), inserted into the 'Selection changed' secton of a list box:
If "[Data_Listbox]" "=""• List of major stadiums in South Africa"
pdfOpen "\\Server\d\I&R_Docs\Toolkit\PDF\Stadiums.pdf" "Rectangle3"
GotoPage "PDF page"
Endif

The listbox contains about ten similar If statements, each pointing to a different PDF document.

..and so to Page B (PDF Page), which of course also contains Rectangle3:
Button contains the following in the 'Click' properties:
ReturnToPage

...taking you back to Page A.

Hope this helps. Thanks for your trouble!

--Charl

PDF Plugin problem

PostPosted: Fri Jun 11, 2004 10:02 am
by Sam Cox
Hi sunscreen202,

I duplicated your problem and have a work-around. Perhaps NeoBook Support can tell us why your original code does not work.

I'll use your code as the framework for my work-around:

   If "[Data_Listbox]" "=" "• List of major stadiums in South Africa"
       setvar "[pdffile]" "\\Server\d\I&R_Docs\Toolkit\PDF\Stadiums.pdf"
       GotoPage "PDF page"
   Endif

In the PageProperties::Actions:PageEnter section on the "PDF page", add this code

   pdfLoadFromWeb "[pdffile]" "Rectangle3"

I used 'pdfLoadFromWeb' instead of 'pdfOpen' which worked better for me loading non-local PDF files.

Until I put the 'pdfLoadFromWeb' or 'pdfOpen' action command on the same page as the rectangle object, I could apparently load only the first file and attempts to view another PDF file in the same rectangle didn't work. When I put the PDF load/open command on the same page as the rectangle, all worked as exepcted.

(Edited by Sam Cox at 7:10 am on June 11, 2004)

PDF Plugin problem

PostPosted: Fri Jun 11, 2004 11:17 am
by Neosoft Support
I believe that this probably has something to do with the fact that the PDF object originates from a plug-in. To conserve memory and resources, plug-in based objects are placed in a kind of stasis when they are not visible. This doesn't seem to interfere with other plug-ins, but could be the cause of the problem you encountered with the pdfOpen action.

You can resolve the problem using Sam's suggestion or simply modify your script so that the GotoPage action is called before pdfLoad. For example:

If "[Data_Listbox]" "=""• List of major stadiums in South Africa"
 GotoPage "PDF page"
pdfOpen "\\Server\d\I&R_Docs\Toolkit\PDF\Stadiums.pdf" "Rectangle3"
Endif

However, if you are loading from the Internet you should use pdfLoadFromWeb instead of pdfOpen.

PDF Plugin problem

PostPosted: Fri Jun 11, 2004 12:39 pm
by sunscreen202
Thanks a million guys, problem solved!