February 2009 Archives

Opening PDFs by URL With Parameters

| No Comments
As documented in the PDFOpenParameter Guide, it is possible to influence the display of PDFs you are opening on the command-line or through a URL using parameters. I found this to be a very cool bit of info. By appending certain parameters using the "#" character, you can have a good amount of control over the display of the PDF document. No fancy programming required.

Scenario 1: Search Results

Let's say that you are providing full-text search functionality for a set of PDF documents (as we are for a current project using a LiveCycle ECM Connector). You can pass the search terms into the PDF reader upon opening the file, making the Reader run a full-text search within the document. It's very cool.

e.g. Searching for "PDF" and "document" in the above PDF using the "search" parameter gives this:

http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf#search="PDF document"

Scenario 2: Hiding the tool-bar

It's self-explanatory: top toolbar begone!

http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf#toolbar=0

There are many other parameters to try out, so get to it!

For Ottawans interested in Flex... and beer.

| No Comments
Is "Ottawan" even a word? (But I digress...)

If you live anywhere near Ottawa, Ontario, Canada and are interested in getting an introduction to Flex development or are a Flex developer already, Adobe is hosting a free evening Flash/Flex camp in Ottawa on Tuesday, March 3rd. From the agenda, it looks like they've made an effort to squeeze in sessions for all levels, from new (i.e. fresh meat) to experienced (i.e. hardened/cynical) Flex developers.

The link to the event is here: http://flashcampfordevelopers.eventbrite.com/

Oh, and I almost forgot to mention: free beer and pizza are on the menu. I am so there.


A hardy Habs fan hat-tip goes out to Jimmy at FlexForce for bringing this to my attention.

ExternalInterface: Flex + Javascript Get Downright Cozy

| 5 Comments

A colleague (Brad) is trying to get his Flex application to talk to a PDF through the HTML wrapper and asked me if I knew how to set up communication between Flex and the browser. I don't know if it will help him much, but I wrote up an e-mail with what I knew and sent it along. Once I was done, I thought that it might just be of help to someone else out there so here is a beefed-up version of what I sent to him (with added home-made diagrams!)

(I apologize ahead of time if the source code formatting isn't ideal... I cut and pasted it from my original e-mail and Outlook really mangled it.)

Flex and Javascript Getting Chatty: The ExternalInterface Class

The ExternalInterface class provides a few static methods that allow both Flex to invoke Javascript functions and Javascript to invoke Flex functions. In usual practice, when run on the web, a Flex SWF is embedded in an HTML document (a.k.a. the HTML "Wrapper"). This document is like any other HTML document, and can therefore include CSS information and Javascript. Thanks to the Flex ExternalInterface class, the Javascript inside the HTML wrapper is exposed to the SWF. The ExternalInterface also allows the SWF to expose a public interface to the HTML wrapper's Javascript code.


browser-html-flex.png

If you take a moment to think about the possibilities, you quickly realize that you can accomplish many powerful things using this functionality...

  • Flex to AJAX communication
  • Flex to Flex communication (within a single HTML wrapper)
  • Flex to Acrobat communication (as in Brad's case)
  • Flex to anything else that exposes functionality to Javascript code in the HTML wrapper (i.e. other plug-ins)

ExternalInterface.png



About this Archive

This page is an archive of entries from February 2009 listed from newest to oldest.

January 2009 is the previous archive.

March 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.