FlashPaper is very useful, we can create web-ready Flash documents or secure, compact PDF files from any printable document in just one click with FlashPaper. The following is some main feature of FlashPaper introduced on the offical site:
- Easily create or e-mail any Microsoft Office document as a Flash document or PDF
- Instantly secure sensitive medical, legal or business documents
- Streamline document distribution with highly compressed files
- Create universally accessible files that are viewable on any platform
- Quickly capture web pages and HTML
- Create online newsletters, flyers and marketing materials
But if you are a flex developer, who has ever tried to load a FlashPaper document within a Flex application, then you should know it’s not so simple. The problem is: when a FlashPaper SWF is loaded in the flash player directly, as window is resized the area available for the document resizes, but the toolbars at the top stay the same height. Here is a sample on how to load FlashPaper in Flex, you can download full source code from
here.
Flex souce code:
- < ?xml version="1.0" encoding="utf-8"?>
- <mx :WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initType()">
- </mx><mx :Script>
- < ![CDATA[
- import com.magReader.FlashPaperLoader;
- //flashpaper
- private var magReader:FlashPaperLoader;
- private function initType():void
- {
- var urlStr:String = "Fpl.swf?url=template.swf";
- magReader = new FlashPaperLoader();
- magReader.source = urlStr;
- magReader.visible = false;
- magContainer.addChild(magReader);
- //loadingBar.visible = true;
- magReader.addEventListener(FlashPaperLoader.FLASH_PAPER_LOADED,fpLoaded);
- }
- //flashpaper
- private function fpLoaded(evt:Event):void
- {
- //trace("magContainer width = " + magContainer.width + " magContainer height = " + magContainer.height);
- magReader.setSize(magContainer.width,magContainer.height);
- magReader.visible = true;
- //loadingBar.visible = false;
- //magContainer.removeChild(loadingBar);
- magReader.removeEventListener(FlashPaperLoader.FLASH_PAPER_LOADED,fpLoaded);
- }
- public function changSize():void
- {
- if(magReader != null)
- {
- magReader.setSize(magContainer.width,magContainer.height);
- }
- }
- ]]>
- </mx>
- <mx :Canvas id="magContainer" width="100%" height="100%" resize="changSize()" horizontalScrollPolicy="off" verticalScrollPolicy="off">
- </mx>
For help, advice, tips and tricks, challenges, feel free to visit our
or Submit your good resource to share.
Reminder: Unless stated otherwise, all resources published on this site are NOT for commercial use. To use any resource from this site for commercial purposes, please contact the author.


Really nice! Thank you very much!
I have one question. How can i set the current page or hide UI Elements like the zoom?
I tried it in the FlasPaperLoader Class with
sendFlashConn.send(”_flashpaperloader”,”setCurrentPage”, 3);
or
sendFlashConn.send(”_flashpaperloader”,”showUIElement”, “Zoom”, false);
but this does not work.