dynamically embed PDF?
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: dynamically embed PDF?

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    3

    dynamically embed PDF?

    Hi,

    I have a client that has an existing flash site, and they want me to modify it to have their menu (its a restaurant) which they upload as a pdf every few days to be embedded within the movie (currently it pops over the site in a new window) what do I need to do to have flash look for that pdf and load it inline?

    Is it a PHP thing? Actionscript?

    I've seen loads of tutorials for creating dynamic galleries, but those are overkill. I only need to have a single page PDF....

    any help would be greatly appreciated!

    James

  2. #2
    Dignitary rynoe's Avatar
    Join Date
    Jan 2003
    Location
    Earth
    Posts
    756
    Photoshop can convert to jpg. As long as you can keep the name of the pdf the same, you can just load it as a regular graphic.
    Last edited by rynoe; 05-29-2012 at 04:55 PM. Reason: cat died

  3. #3
    Member
    Join Date
    May 2012
    Posts
    51
    To embed a PDF file, you'll need to convert it to SWF first. I used to use Flash Paper for this purpose, but that product has been discontinued. Integrating AVM1 stuff into an AS3 environment can also be a real bear. There's an open-source tool called SWF Tools that can convert a PDF file into SWF. Every page ends up in a separate file. Typically people stick the results into a some sort of page-flip Flash component. In your case, you can just load that single file.

  4. #4
    Junior Member
    Join Date
    May 2012
    Posts
    3
    okay, those options are not going to work, because I (they) want to keep user experience as it has been, where they upload a pdf that they have created and formatted. is there a way to have flash display a website WITHIN a movie? I could use PHP to generate the page....

  5. #5
    Dignitary rynoe's Avatar
    Join Date
    Jan 2003
    Location
    Earth
    Posts
    756
    Flash is a plug-in, meaning it is embedded within markup language.

    You could embed a pdf within html and use javascript to communicate between the html and AS.

  6. #6
    Member
    Join Date
    May 2012
    Posts
    51
    Quote Originally Posted by jamesbarner View Post
    okay, those options are not going to work, because I (they) want to keep user experience as it has been, where they upload a pdf that they have created and formatted. is there a way to have flash display a website WITHIN a movie? I could use PHP to generate the page....
    You can't put a website inside a Flash movie. What you can do is put an IFRAME over it with absolute CSS positioning. Normally, this arrangement wouldn't work, as the Flash plug-in bypasses the browser's rendering engine. In this case, since you're putting a PDF in the IFRAME, it should work, as the file is displayed through a plug-in as well. In the Flash movie itself, you use ExternalInterface to call a Javascript function that toggle the display state of the IFRAME on and off. It's somewhat of a hack. You'll have to check it across different browsers to make sure it works properly.

    SWF-Tools is a command-line tool. You use a PHP script to run it. It's a good solution provided that you have root access on the server. There is the downside of visitors not being able to select the text. You also need to implement scrolling and printing.

  7. #7
    Junior Member
    Join Date
    May 2012
    Posts
    3
    and this iframe would float over the top of the flash movie? wouldn't that break if the window was resized? it's a liquid layout with the movie in the center....

  8. #8
    Member
    Join Date
    May 2012
    Posts
    51
    Quote Originally Posted by jamesbarner View Post
    and this iframe would float over the top of the flash movie? wouldn't that break if the window was resized? it's a liquid layout with the movie in the center....
    Yeah, it's going to be a challenge making it look right. If you position the iframe with the CSS attributes left, right, top, and bottom, it should resize with the window--in theory at least. Something tells me that it's going to break in IE6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com