MXML to PDF

I know we have PDF generation facilities in the new release
of Flex Data Services (which is now LiveCycle Data Services 2.5).
In LC-DS we can design templates using LiveCycle Designer and bind
the template with a data model to generate dynamic PDFs.
But, is there a way to generate PDFs using an MXML file as a
template instead of creating a template in designer?

Hi,
What you talk about is not possible with LCDS.
But it might be possible with Alive PDF.
Check it out.
Regards,
Karl.

Similar Messages

  • Double Space File from GET Download from Server

    Whenever I GET a file within Dreamweaver (FTP) from the server, PHP and CSS files come down as double spaced.
    I've search many forums and changed the Code Format under Preferences but still get the same issues. I'm running the most current version of DW on MAC OSX 10.9.2
    Any help would be greatly appreciated.
    Thanks!
    Dan

    I'm wondering if Dreamweaver is tranfering your text files in Binary mode instead of ASCII.  It might be worth looking at your FTPExtensionMap.txt file inside your Configuration folder.
    On my system, it's located in [my UserName] /AppData/Roaming/Adobe/DreamweaverCS6/en_US/Configuration.  It looks like this:
    AIF
    BINARY
    AIFF
    BINARY
    AIFC
    BINARY
    AS
    ASCII
    ASCX
    ASCII
    ASMX
    ASCII
    ASP
    ASCII
    ASPX
    ASCII
    BIN
    BINARY
    BMP
    BINARY
    CFM
    ASCII
    CFML
    ASCII
    CGI
    ASCII
    CS
    ASCII
    CSS
    ASCII
    DCR
    BINARY
    DIR
    BINARY
    DMG
    BINARY
    DOC
    BINARY
    DWT
    ASCII
    DXR
    BINARY
    EXE
    BINARY
    FLA
    BINARY
    GIF
    BINARY
    HTM
    ASCII
    HTML
    ASCII
    INC
    ASCII
    JPG
    BINARY
    JPEG
    BINARY
    JS
    ASCII
    LBI
    ASCII
    MNO
    BINARY
    MOV
    BINARY
    MPEG
    BINARY
    MPG
    BINARY
    MXML
    ASCII
    PDF
    BINARY
    PHP
    ASCII
    PHP3
    ASCII
    PHP4
    ASCII
    PHP5
    ASCII
    PIC
    BINARY
    PICT
    BINARY
    PL
    ASCII
    PNG
    BINARY
    PSD
    BINARY
    QT
    BINARY
    RA
    BINARY
    RAM
    BINARY
    README
    BINARY
    RM
    BINARY
    RTF
    BINARY
    SEA
    BINARY
    SHTM
    ASCII
    SHTML
    ASCII
    SIT
    BINARY
    SND
    BINARY
    SWF
    BINARY
    TEXT
    ASCII
    TIF
    BINARY
    TIFF
    BINARY
    TPL
    BINARY
    TXT
    ASCII
    VB
    ASCII
    WAV
    BINARY
    XHTM
    ASCII
    XHTML
    ASCII
    ZIP
    BINARY
    Nancy O.

  • Closing mxml container using a button on a PDF form

    i'm working on an adobe air application using flex builder. Inside this application I use the mxml container in flex to open a pdf form that is designed using livecycle Designer 8.2. I have exit buttons on the form that use the following code to close the form:
    var myDoc = event.target;
    myDoc.closeDoc(true);
    This code works just fine when the form is opened in acrobat reader but it doesnt work when it is opened from inside the flex container. Is there any way i can close the form and the container by clicking a button from inside the form.
    Thanks
    Karim Ainine

    Set the button's properties to "Visible but doesn't print"

  • How to generate PDF using selcted row from datagrid in mxml flex4 web application

    hi friends.
    i am using flex4 web application with mxml tabs.
    i am having one datagrid and one button outside the grid ,
    i   am having one datagrid in that i am having 5 records if i click a   record from the datagrid then click that button means that particular   record will save as PDF in my local PC.
    How to do that,
    Any suggession or examples.
    Thanks in advance
    B.venkatesan.

    Thanks Vibhuti,
    i got some idea abt PDF save bt please tell .i have some doubts in this code
    var bytes:ByteArray = claimPDF.save(Method.LOCAL);
    var f:FileReference = new FileReference();
    f.save(bytes,"tourdeflex-pdf-sample.pdf");
    what is claimpdf and Method? it show undefiened probery error
    and f and bytes also show the same error.
    what header files i have to import for file reference concepts;
    i am using FLASH PLAYER 10;
    tell what i will do
    Thanks
    B.venkatesan

  • URGENT! Alive PDF - export PDF file ("my computer" prompt to save the file, not create in browser)

    Hi - I'm having issues with my code and I'm not an ActionScript coder by any means. I'm using Flash Builder 4. I've been able to figure out how to export to PNG and to XLS but PDF is really killing me.
    Below is my code and it's not causing errors when I do the release build but the my button doesn't work to export to PDF.  I'm trying to create a PNG using the PNGEncoder and then push that out to PDF (when the PDF button is selected). I used some sample code and I've commented out parts that I didn't want to use or didn't seem to apply to my application. Unfortunately, I have a deadline of May 3rd on this and there is no one else in the office here to help me... hope someone out there can.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" height="650" width="850">
        <mx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                import flash.events.Event;
                import mx.events.DropdownEvent;
                import mx.events.*;
                import mx.graphics.codec.PNGEncoder;
                import org.alivepdf.display.*;
                import org.alivepdf.images.ColorSpace;
                import org.alivepdf.fonts.*;
                import org.alivepdf.layout.*;
                import org.alivepdf.pdf.*;
                import org.alivepdf.saving.*;
                import mx.controls.Alert;
                //PDF Export information
                protected var pdf:PDF;
                protected function savePDF(event:MouseEvent): void {
                    pdf = new PDF(Orientation.LANDSCAPE, Unit.MM, Size.LETTER);
                    pdf.setDisplayMode(Display.FULL_WIDTH);
                    pdf.addPage();
                    var bd:BitmapData = new BitmapData(cChart.width,cChart.height);
                    bd.draw(cChart);
                    var png:PNGEncoder = new PNGEncoder();
                    var ba:ByteArray = png.encode(bd);
                    //try {
                    pdf.addImageStream(ba, ColorSpace.DEVICE_RGB, new Resize ( Mode.FIT_TO_PAGE, Position.CENTERED ), 10, 10, 800, 800, 0, 1, "Normal", null);
                    //} catch (e:Error) {
                    //    trace("Error occurred!");
                    //    Alert.show(e,"");
                    //myPDF.addImageStream(new jpgBytes() as ByteArray, ColorSpace.DEVICE_RGB, null, 0, 0, 500, 500, 0, 1, "Normal", null);
                    //imageBytes:ByteArray, colorSpace:String, resizeMode:Resize=null, x:Number=0, y:Number=0, width:Number=0, height:Number=0, rotation:Number=0, alpha:Number=1, blendMode:String="Normal", link:ILink=null):
                    //pdf.setFont(FontFamily.ARIAL, Style.NORMAL, 12);
                    //pdf.addText("Grafico de Rata de Fallas", 100, 40); // title
                    //pdf.addImage(imprimirRata, 50, 50, 200, 150); // captured canvas with charts
                    //      pdf.addImage(leyendaImprimir, 50, 120, 20,20); // captured leyend of charts
                    //pdf.addText("RTP Software. Modulo de Score Card.", 10, 200); // header of the document
                    //pdf.addText("Creado: " + new Date(), 180, 200); // Add the created date as a leyend or footer on document
                    var fr:FileReference = new FileReference();
                    fr.save(pdf.save(Method.LOCAL), "nep_piefy11.pdf");
                    /*var fs:FileStream = new FileStream();
                    var file: File = File.desktopDirectory.resolvePath("nep_piefy11.pdf"); // Name of the file
                    fs.open(file, FileMode.WRITE);
                    fs.writeBytes(pdf.save(Method.LOCAL));
                    fs.close();*/
                    //Alert.show("El reporte ha sido generado", "Informacion"); // Confirmation message as a pop-up
                //Pie Chart Creation information
                [Bindable]
                public var ds:ArrayCollection = sel;
                private function changeEvt(event:Event):void {
                    if(filterCombo.selectedItem == 'Select NEP') {ds = sel;}
                    if(filterCombo.selectedItem == 'Albemarle-Pamlico Estuary Program') {ds = nep1;}
                    if(filterCombo.selectedItem == 'Barataria-Terrebonne Estuary Program') {ds = nep2;}
                    if(filterCombo.selectedItem == 'Barnegat Bay Estuary Program') {ds = nep3;}
                    if(filterCombo.selectedItem == 'Buzzards Bay National Estuary Program') {ds = nep4;}
                    if(filterCombo.selectedItem == 'Casco Bay Estuary Partnership') {ds = nep5;}
                    if(filterCombo.selectedItem == 'Charlotte Harbor Estuary Program') {ds = nep6;}
                    if(filterCombo.selectedItem == 'Coastal Bend Bays and Estuaries Program') {ds = nep7;}
                    if(filterCombo.selectedItem == 'Delaware Estuary Program') {ds = nep8;}
                    if(filterCombo.selectedItem == 'Delaware Inland Bays Estuary Program') {ds = nep9;}
                    if(filterCombo.selectedItem == 'Galveston Bay Estuary Program') {ds = nep10;}
                    if(filterCombo.selectedItem == 'Indian River Lagoon NEP') {ds = nep11;}
                    if(filterCombo.selectedItem == 'Long Island Sound Study') {ds = nep12;}
                    if(filterCombo.selectedItem == 'Lower Columbia River Estuary') {ds = nep13;}
                    if(filterCombo.selectedItem == 'Maryland Coastal Bays Program') {ds = nep14;}
                    if(filterCombo.selectedItem == 'Massachusetts Bays NEP') {ds = nep15;}
                    if(filterCombo.selectedItem == 'Mobile Bay Estuary Program') {ds = nep16;}
                    if(filterCombo.selectedItem == 'Morro Bay Estuary Program') {ds = nep17;}
                    if(filterCombo.selectedItem == 'Narragansett Bay Estuary Program') {ds = nep18;}
                    if(filterCombo.selectedItem == 'New York-New Jersey Harbor Estuary Program') {ds = nep19;}
                    if(filterCombo.selectedItem == 'Peconic Estuary Program') {ds = nep20;}
                    if(filterCombo.selectedItem == 'Piscataqua Region Estuaries Partnership') {ds = nep21;}
                    if(filterCombo.selectedItem == 'Puget Sound Partnership') {ds = nep22;}
                    if(filterCombo.selectedItem == 'San Francisco Estuary Project') {ds = nep23;}
                    if(filterCombo.selectedItem == 'San Juan Bay NEP') {ds = nep24;}
                    if(filterCombo.selectedItem == 'Santa Monica Bay Restoration Project') {ds = nep25;}
                    if(filterCombo.selectedItem == 'Sarasota Bay Estuary Program') {ds = nep26;}
                    if(filterCombo.selectedItem == 'Tampa Bay Estuary Program') {ds = nep27;}
                    if(filterCombo.selectedItem == 'Tillamook Estuaries Partnership') {ds = nep28;}
                [Bindable]
                private var sel:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0.5},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 0} ]);
                [Bindable]
                private var nep1:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 778.44},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0.45},
                    { habtype: "Estuarine Shoreline", Acres: 1276.30},
                    { habtype: "Instream", Acres: 1.0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0.75},
                    { habtype: "Upland", Acres: 779.74},
                    { habtype: "Wetland", Acres: 3268.31} ]);
                [Bindable]
                private var nep2:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 7.25},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 1185} ]);
                [Bindable]
                private var nep3:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 35.21},
                    { habtype: "Upland", Acres: 852.57},
                    { habtype: "Wetland", Acres: 197.82} ]);
                [Bindable]
                private var nep4:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 751.82},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 321.82},
                    { habtype: "Wetland", Acres: 157.35} ]);
                [Bindable]
                private var nep5:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 217},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 324.5},
                    { habtype: "Wetland", Acres: 0} ]);
                [Bindable]
                private var nep6:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 1268},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 50},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 61},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 809},
                    { habtype: "Wetland", Acres: 1690} ]);
                [Bindable]
                private var nep7:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 726} ]);
                [Bindable]
                private var nep8:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0.28},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 82},
                    { habtype: "Estuarine Shoreline", Acres: 0.14},
                    { habtype: "Instream", Acres: 2.3},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 643},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 501.9},
                    { habtype: "Upland", Acres: 148.71},
                    { habtype: "Wetland", Acres: 2586.02} ]);
                [Bindable]
                private var nep9:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 26.21},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 37},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 27},
                    { habtype: "Wetland", Acres: 646} ]);
                [Bindable]
                private var nep10:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 2868},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 407.06} ]);
                [Bindable]
                private var nep11:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 5},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 3},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 43},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 12910.5},
                    { habtype: "Wetland", Acres: 5026} ]);
                [Bindable]
                private var nep12:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 67},
                    { habtype: "Beach/Dune", Acres: 21.95},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 120.72},
                    { habtype: "Wetland", Acres: 151.08} ]);
                [Bindable]
                private var nep13:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 12},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 194},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 200} ]);
                [Bindable]
                private var nep14:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 58},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 153},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 494.3},
                    { habtype: "Wetland", Acres: 0} ]);
                [Bindable]
                private var nep15:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 1313},
                    { habtype: "Estuarine Shoreline", Acres: 8},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 543.8} ]);
                [Bindable]
                private var nep16:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 40},
                    { habtype: "Estuarine Shoreline", Acres: 6.5},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 195},
                    { habtype: "Wetland", Acres: 85} ]);
                [Bindable]
                private var nep17:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 1109.9},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 1.14},
                    { habtype: "Estuarine Shoreline", Acres: 0.28},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0.71},
                    { habtype: "Wetland", Acres: 0} ]);
                [Bindable]
                private var nep18:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 1099},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 0} ]);
                [Bindable]
                private var nep19:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 101.3} ]);
                [Bindable]
                private var nep20:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 98.72},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 17.99},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 106.13},
                    { habtype: "Wetland", Acres: 12.97} ]);
                [Bindable]
                private var nep21:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 9},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 3},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 2},
                    { habtype: "Upland", Acres: 1451},
                    { habtype: "Wetland", Acres: 27} ]);
                [Bindable]
                private var nep22:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 26},
                    { habtype: "Beach/Dune", Acres: 1.65},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 240.39},
                    { habtype: "Estuarine Shoreline", Acres: 314.97},
                    { habtype: "Instream", Acres: 505.87},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 1450.47},
                    { habtype: "Upland", Acres: 1176.7},
                    { habtype: "Wetland", Acres: 850.58} ]);
                [Bindable]
                private var nep23:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 43.05},
                    { habtype: "Upland", Acres: 4519},
                    { habtype: "Wetland", Acres: 3271} ]);
                [Bindable]
                private var nep24:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 1},
                    { habtype: "Coral Reef", Acres: 0.13},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 1},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 10} ]);
                [Bindable]
                private var nep25:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 1.6},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 7},
                    { habtype: "Riparian", Acres: 100},
                    { habtype: "Upland", Acres: 6.2},
                    { habtype: "Wetland", Acres: 0} ]);
                [Bindable]
                private var nep26:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 5.5},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 4.5},
                    { habtype: "Estuarine Shoreline", Acres: 15},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 82},
                    { habtype: "Wetland", Acres: 40} ]);
                [Bindable]
                private var nep27:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 5.1},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 23},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 4.8},
                    { habtype: "Mangrove", Acres: 3.5},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 1221},
                    { habtype: "Wetland", Acres: 17.4}]);   
                [Bindable]
                private var nep28:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 67},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 2},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 31.33},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 74.24}]);               
                private function displayAcres(data:Object, field:String, index:Number, percentValue:Number):String {
                    var temp:String= (" " + percentValue).substr(0,6);
                    return data.habtype + ": " + '\n ' + data.Acres + " Acres" + '\n ' + temp + "%";
                //Export to PNG information
                private function saveImageAs(event:MouseEvent):void
                    var bd:BitmapData = new BitmapData(cChart.width,cChart.height);
                    bd.draw(cChart);
                    var png:PNGEncoder = new PNGEncoder();
                    var ba:ByteArray = png.encode(bd);
                    var fr:FileReference = new FileReference();
                    fr.save(ba, "nepfy11-piechart.png");
            ]]>
        </mx:Script>
        <!--mx:SeriesInterpolate id="chartChange" duration="2000" /-->
        <mx:Panel id="cChart" title="2011 Habitat Efforts" width="825" height="600" chromeColor="#527EAC" layout="vertical" color="#FFFFFF" verticalGap="10" x="15" y="15">
            <mx:HBox width="400" height="20">
                <mx:ComboBox id="filterCombo" x="140" y="140" change="changeEvt(event)" color="#000000" >
                    <mx:String>Select NEP</mx:String>
                    <mx:String>Albemarle-Pamlico Estuary Program</mx:String>
                    <mx:String>Barataria-Terrebonne Estuary Program</mx:String>
                    <mx:String>Barnegat Bay Estuary Program</mx:String>
                    <mx:String>Buzzards Bay National Estuary Program</mx:String>
                    <mx:String>Casco Bay Estuary Partnership</mx:String>
                    <mx:String>Charlotte Harbor Estuary Program</mx:String>
                    <mx:String>Coastal Bend Bays and Estuaries Program</mx:String>
                    <mx:String>Delaware Estuary Program</mx:String>
                    <mx:String>Delaware Inland Bays Estuary Program</mx:String>
                    <mx:String>Galveston Bay Estuary Program</mx:String>
                    <mx:String>Indian River Lagoon NEP</mx:String>
                    <mx:String>Long Island Sound Study</mx:String>
                    <mx:String>Lower Columbia River Estuary</mx:String>
                    <mx:String>Maryland Coastal Bays Program</mx:String>
                    <mx:String>Massachusetts Bays NEP</mx:String>
                    <mx:String>Mobile Bay Estuary Program</mx:String>
                    <mx:String>Morro Bay Estuary Program</mx:String>
                    <mx:String>Narragansett Bay Estuary Program</mx:String>
                    <mx:String>New York-New Jersey Harbor Estuary Program</mx:String>
                    <mx:String>Peconic Estuary Program</mx:String>
                    <mx:String>Piscataqua Region Estuaries Partnership</mx:String>
                    <mx:String>Puget Sound Partnership</mx:String>
                    <mx:String>San Francisco Estuary Project</mx:String>
                    <mx:String>San Juan Bay NEP</mx:String>
                    <mx:String>Santa Monica Bay Restoration Project</mx:String>
                    <mx:String>Sarasota Bay Estuary Program</mx:String>
                    <mx:String>Tampa Bay Estuary Program</mx:String>
                    <mx:String>Tillamook Estuaries Partnership</mx:String>
                </mx:ComboBox>
            </mx:HBox>
            <mx:HBox horizontalGap="20" width="822" height="535">
                <mx:PieChart id="chart" showDataTips="true" dataProvider="{ds}" width="634"  height="534" paddingTop="10" fontSize="9" fontFamily="Arial" color="#000000" textAlign="left">
                    <mx:series>
                        <mx:PieSeries id="seriesId" explodeRadius="0.06" nameField="habtype" labelPosition="callout" color="#000000" insideLabelSizeLimit="8" field="Acres" labelFunction="displayAcres">
                        </mx:PieSeries>
                    </mx:series>
                </mx:PieChart>
                <mx:Legend dataProvider="{chart}" dropShadowVisible="true" width="150" color="#000000" height="350" chromeColor="#527EAC" borderColor="#527EAC" direction="vertical"/>          
            </mx:HBox>
        </mx:Panel>
        <mx:Button x="734" y="623" label="Export Pie Chart" id="btnSnap" click="saveImageAs(event)"/>
        <mx:Button x="444" y="623" label="PDF" click="savePDF(event)" />
    </mx:Application>
    Thank you in advance,
    Alison

    I figured it out!!!!! In case anyone else needs to know - here is the working code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" height="650" width="850">
        <mx:Script>
            <![CDATA[
                import flash.events.Event;
                import mx.collections.ArrayCollection;
                import mx.controls.Alert;
                import mx.events.*;
                import mx.events.DropdownEvent;
                import mx.graphics.codec.PNGEncoder;
                import org.alivepdf.display.*;
                import org.alivepdf.fonts.*;
                import org.alivepdf.images.ColorSpace;
                import org.alivepdf.images.PDFImage;
                import org.alivepdf.layout.*;
                import org.alivepdf.pdf.*;
                import org.alivepdf.saving.*;
                //PDF Export information
                private var pdf:PDF;
                private function savePDF(event:MouseEvent): void {
                    pdf = new PDF(Orientation.LANDSCAPE, Unit.MM, Size.LETTER);
                    pdf.setDisplayMode(Display.FULL_WIDTH);
                    pdf.addPage();
                    var bd:BitmapData = new BitmapData(cChart.width,cChart.height);
                    bd.draw(cChart);
                    var bm:Bitmap=new Bitmap(bd);
                    //bm.x=825;
                    //bm.y=600;
                    //bm.width=825;
                    pdf.setMargins(0, 2, 0, 0);
                    pdf.addImage(bm, new Resize (Mode.RESIZE_PAGE, Position.CENTERED));
                    //pdf.setXY(10,95);
                    var bytes:ByteArray=pdf.save(Method.LOCAL);
                    var fr:FileReference=new FileReference();
                    fr.save(bytes,"nep_piefy11.pdf");
                //Pie Chart Creation information
                [Bindable]
                public var ds:ArrayCollection = sel;
                private function changeEvt(event:Event):void {
                    if(filterCombo.selectedItem == 'Select NEP') {ds = sel;}
                    if(filterCombo.selectedItem == 'Albemarle-Pamlico Estuary Program') {ds = nep1;}
                    if(filterCombo.selectedItem == 'Barataria-Terrebonne Estuary Program') {ds = nep2;}
                    if(filterCombo.selectedItem == 'Barnegat Bay Estuary Program') {ds = nep3;}
                    if(filterCombo.selectedItem == 'Buzzards Bay National Estuary Program') {ds = nep4;}
                    if(filterCombo.selectedItem == 'Casco Bay Estuary Partnership') {ds = nep5;}
                    if(filterCombo.selectedItem == 'Charlotte Harbor Estuary Program') {ds = nep6;}
                    if(filterCombo.selectedItem == 'Coastal Bend Bays and Estuaries Program') {ds = nep7;}
                    if(filterCombo.selectedItem == 'Delaware Estuary Program') {ds = nep8;}
                    if(filterCombo.selectedItem == 'Delaware Inland Bays Estuary Program') {ds = nep9;}
                    if(filterCombo.selectedItem == 'Galveston Bay Estuary Program') {ds = nep10;}
                    if(filterCombo.selectedItem == 'Indian River Lagoon NEP') {ds = nep11;}
                    if(filterCombo.selectedItem == 'Long Island Sound Study') {ds = nep12;}
                    if(filterCombo.selectedItem == 'Lower Columbia River Estuary') {ds = nep13;}
                    if(filterCombo.selectedItem == 'Maryland Coastal Bays Program') {ds = nep14;}
                    if(filterCombo.selectedItem == 'Massachusetts Bays NEP') {ds = nep15;}
                    if(filterCombo.selectedItem == 'Mobile Bay Estuary Program') {ds = nep16;}
                    if(filterCombo.selectedItem == 'Morro Bay Estuary Program') {ds = nep17;}
                    if(filterCombo.selectedItem == 'Narragansett Bay Estuary Program') {ds = nep18;}
                    if(filterCombo.selectedItem == 'New York-New Jersey Harbor Estuary Program') {ds = nep19;}
                    if(filterCombo.selectedItem == 'Peconic Estuary Program') {ds = nep20;}
                    if(filterCombo.selectedItem == 'Piscataqua Region Estuaries Partnership') {ds = nep21;}
                    if(filterCombo.selectedItem == 'Puget Sound Partnership') {ds = nep22;}
                    if(filterCombo.selectedItem == 'San Francisco Estuary Project') {ds = nep23;}
                    if(filterCombo.selectedItem == 'San Juan Bay NEP') {ds = nep24;}
                    if(filterCombo.selectedItem == 'Santa Monica Bay Restoration Project') {ds = nep25;}
                    if(filterCombo.selectedItem == 'Sarasota Bay Estuary Program') {ds = nep26;}
                    if(filterCombo.selectedItem == 'Tampa Bay Estuary Program') {ds = nep27;}
                    if(filterCombo.selectedItem == 'Tillamook Estuaries Partnership') {ds = nep28;}
                [Bindable]
                private var sel:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0.5},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 0} ]);
                [Bindable]
                private var nep1:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 778.44},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0.45},
                    { habtype: "Estuarine Shoreline", Acres: 1276.30},
                    { habtype: "Instream", Acres: 1.0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0.75},
                    { habtype: "Upland", Acres: 779.74},
                    { habtype: "Wetland", Acres: 3268.31} ]);
                [Bindable]
                private var nep2:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 7.25},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 1185} ]);
                [Bindable]
                private var nep3:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 35.21},
                    { habtype: "Upland", Acres: 852.57},
                    { habtype: "Wetland", Acres: 197.82} ]);
                [Bindable]
                private var nep4:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 751.82},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 321.82},
                    { habtype: "Wetland", Acres: 157.35} ]);
                [Bindable]
                private var nep5:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 217},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 324.5},
                    { habtype: "Wetland", Acres: 0} ]);
                [Bindable]
                private var nep6:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 1268},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 50},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 61},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 809},
                    { habtype: "Wetland", Acres: 1690} ]);
                [Bindable]
                private var nep7:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 726} ]);
                [Bindable]
                private var nep8:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0.28},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 82},
                    { habtype: "Estuarine Shoreline", Acres: 0.14},
                    { habtype: "Instream", Acres: 2.3},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 643},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 501.9},
                    { habtype: "Upland", Acres: 148.71},
                    { habtype: "Wetland", Acres: 2586.02} ]);
                [Bindable]
                private var nep9:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 26.21},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 37},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 27},
                    { habtype: "Wetland", Acres: 646} ]);
                [Bindable]
                private var nep10:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 2868},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 407.06} ]);
                [Bindable]
                private var nep11:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 5},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 3},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 43},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 12910.5},
                    { habtype: "Wetland", Acres: 5026} ]);
                [Bindable]
                private var nep12:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 67},
                    { habtype: "Beach/Dune", Acres: 21.95},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 120.72},
                    { habtype: "Wetland", Acres: 151.08} ]);
                [Bindable]
                private var nep13:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 12},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 194},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 200} ]);
                [Bindable]
                private var nep14:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 58},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 153},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 494.3},
                    { habtype: "Wetland", Acres: 0} ]);
                [Bindable]
                private var nep15:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 1313},
                    { habtype: "Estuarine Shoreline", Acres: 8},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 543.8} ]);
                [Bindable]
                private var nep16:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 40},
                    { habtype: "Estuarine Shoreline", Acres: 6.5},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 195},
                    { habtype: "Wetland", Acres: 85} ]);
                [Bindable]
                private var nep17:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 1109.9},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 1.14},
                    { habtype: "Estuarine Shoreline", Acres: 0.28},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0.71},
                    { habtype: "Wetland", Acres: 0} ]);
                [Bindable]
                private var nep18:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 1099},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 0} ]);
                [Bindable]
                private var nep19:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 101.3} ]);
                [Bindable]
                private var nep20:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 98.72},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 17.99},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 106.13},
                    { habtype: "Wetland", Acres: 12.97} ]);
                [Bindable]
                private var nep21:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 9},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 3},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 2},
                    { habtype: "Upland", Acres: 1451},
                    { habtype: "Wetland", Acres: 27} ]);
                [Bindable]
                private var nep22:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 26},
                    { habtype: "Beach/Dune", Acres: 1.65},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 240.39},
                    { habtype: "Estuarine Shoreline", Acres: 314.97},
                    { habtype: "Instream", Acres: 505.87},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 1450.47},
                    { habtype: "Upland", Acres: 1176.7},
                    { habtype: "Wetland", Acres: 850.58} ]);
                [Bindable]
                private var nep23:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 43.05},
                    { habtype: "Upland", Acres: 4519},
                    { habtype: "Wetland", Acres: 3271} ]);
                [Bindable]
                private var nep24:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 1},
                    { habtype: "Coral Reef", Acres: 0.13},
                    { habtype: "Estuarine", Acres: 0},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 1},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 10} ]);
                [Bindable]
                private var nep25:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 1.6},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 7},
                    { habtype: "Riparian", Acres: 100},
                    { habtype: "Upland", Acres: 6.2},
                    { habtype: "Wetland", Acres: 0} ]);
                [Bindable]
                private var nep26:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 5.5},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 4.5},
                    { habtype: "Estuarine Shoreline", Acres: 15},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 82},
                    { habtype: "Wetland", Acres: 40} ]);
                [Bindable]
                private var nep27:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 0},
                    { habtype: "Beach/Dune", Acres: 5.1},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 23},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 4.8},
                    { habtype: "Mangrove", Acres: 3.5},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 0},
                    { habtype: "Upland", Acres: 1221},
                    { habtype: "Wetland", Acres: 17.4}]);   
                [Bindable]
                private var nep28:ArrayCollection = new ArrayCollection( [
                    { habtype: "Agriculture/Ranch Land", Acres: 67},
                    { habtype: "Beach/Dune", Acres: 0},
                    { habtype: "Coral Reef", Acres: 0},
                    { habtype: "Estuarine", Acres: 2},
                    { habtype: "Estuarine Shoreline", Acres: 0},
                    { habtype: "Instream", Acres: 0},
                    { habtype: "Island", Acres: 0},
                    { habtype: "Lake/Pond", Acres: 0},
                    { habtype: "Mangrove", Acres: 0},
                    { habtype: "Other", Acres: 0},
                    { habtype: "Riparian", Acres: 31.33},
                    { habtype: "Upland", Acres: 0},
                    { habtype: "Wetland", Acres: 74.24}]);               
                private function displayAcres(data:Object, field:String, index:Number, percentValue:Number):String {
                    var temp:String= (" " + percentValue).substr(0,6);
                    return data.habtype + ": " + '\n ' + data.Acres + " Acres" + '\n ' + temp + "%";
                //Export to PNG information
                private function saveImageAs(event:MouseEvent):void
                    var bd:BitmapData = new BitmapData(cChart.width,cChart.height);
                    bd.draw(cChart);
                    var png:PNGEncoder = new PNGEncoder();
                    var ba:ByteArray = png.encode(bd);
                    var fr:FileReference = new FileReference();
                    fr.save(ba, "nepfy11-piechart.png");
            ]]>
        </mx:Script>
        <!--mx:SeriesInterpolate id="chartChange" duration="2000" /-->
        <mx:Panel id="cChart" title="2011 Habitat Efforts" width="825" height="600" chromeColor="#527EAC" layout="vertical" color="#FFFFFF" verticalGap="10" x="15" y="15">
            <mx:HBox width="400" height="20">
                <mx:ComboBox id="filterCombo" x="140" y="140" change="changeEvt(event)" color="#000000" >
                    <mx:String>Select NEP</mx:String>
                    <mx:String>Albemarle-Pamlico Estuary Program</mx:String>
                    <mx:String>Barataria-Terrebonne Estuary Program</mx:String>
                    <mx:String>Barnegat Bay Estuary Program</mx:String>
                    <mx:String>Buzzards Bay National Estuary Program</mx:String>
                    <mx:String>Casco Bay Estuary Partnership</mx:String>
                    <mx:String>Charlotte Harbor Estuary Program</mx:String>
                    <mx:String>Coastal Bend Bays and Estuaries Program</mx:String>
                    <mx:String>Delaware Estuary Program</mx:String>
                    <mx:String>Delaware Inland Bays Estuary Program</mx:String>
                    <mx:String>Galveston Bay Estuary Program</mx:String>
                    <mx:String>Indian River Lagoon NEP</mx:String>
                    <mx:String>Long Island Sound Study</mx:String>
                    <mx:String>Lower Columbia River Estuary</mx:String>
                    <mx:String>Maryland Coastal Bays Program</mx:String>
                    <mx:String>Massachusetts Bays NEP</mx:String>
                    <mx:String>Mobile Bay Estuary Program</mx:String>
                    <mx:String>Morro Bay Estuary Program</mx:String>
                    <mx:String>Narragansett Bay Estuary Program</mx:String>
                    <mx:String>New York-New Jersey Harbor Estuary Program</mx:String>
                    <mx:String>Peconic Estuary Program</mx:String>
                    <mx:String>Piscataqua Region Estuaries Partnership</mx:String>
                    <mx:String>Puget Sound Partnership</mx:String>
                    <mx:String>San Francisco Estuary Project</mx:String>
                    <mx:String>San Juan Bay NEP</mx:String>
                    <mx:String>Santa Monica Bay Restoration Project</mx:String>
                    <mx:String>Sarasota Bay Estuary Program</mx:String>
                    <mx:String>Tampa Bay Estuary Program</mx:String>
                    <mx:String>Tillamook Estuaries Partnership</mx:String>
                </mx:ComboBox>
            </mx:HBox>
            <mx:HBox horizontalGap="20" width="822" height="535">
                <mx:PieChart id="chart" showDataTips="true" dataProvider="{ds}" width="634"  height="534" paddingTop="10" fontSize="9" fontFamily="Arial" color="#000000" textAlign="left">
                    <mx:series>
                        <mx:PieSeries id="seriesId" explodeRadius="0.06" nameField="habtype" labelPosition="callout" color="#000000" insideLabelSizeLimit="8" field="Acres" labelFunction="displayAcres">
                        </mx:PieSeries>
                    </mx:series>
                </mx:PieChart>
                <mx:Legend dataProvider="{chart}" dropShadowVisible="true" width="150" color="#000000" height="350" chromeColor="#527EAC" borderColor="#527EAC" direction="vertical"/>          
            </mx:HBox>
        </mx:Panel>
        <mx:Button x="746" y="623" label="Export to PNG" id="btnSnap" click="saveImageAs(event)"/>
        <mx:Button x="651" y="623" label="Export to PDF" click="savePDF(event)" />
    </mx:Application>
    Thanks, Alison

  • How to open a PDF File from a ByteArray

    Hi, Fellows,
    I'm having the following problem:
    I have put a PDF file inside a BLOB field in a table in my SQLite database.
    And I can retrieve it from this database without any problem, receiving a ByteArray data type as result.
    What I want to know is what I should do to render this file in my HTML flex object without saving it to a file…
    I used the mx.controls.HTML.data property, but what I see is the TEXT of my PDF file. The mx.controls.HTML.location needs a STRING with the link to a URL site or file.
    Thanks in advance for your help.
    Here, my code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" width="810" height="620"
          creationComplete="creationCompleteHandler();">
          <mx:Script>
                <![CDATA[
                      import flash.data.*;
                      import flash.filesystem.*;
                       private var _connection:SQLConnection;
                      private var _statement:SQLStatement; 
                 private function creationCompleteHandler():void {
                    var file:File = File.applicationStorageDirectory.resolvePath("arq.db");
                    _connection = new SQLConnection();
                    _connection.addEventListener(SQLEvent.OPEN, openHandler);
                    _connection.openAsync(file, SQLMode.CREATE);
                 private function openHandler(event:SQLEvent):void {
                    var sql:SQLStatement = new SQLStatement();
                    sql.sqlConnection = _connection;
                    sql.text = "CREATE TABLE IF NOT EXISTS arq(" +
                               "id INTEGER PRIMARY KEY AUTOINCREMENT, " +
                               "nome TEXT, " + 
                                "arquivo BLOB)";
                    sql.execute();        
                 private function insertFile(identificacao:String, caminho:String):void {
                            var sql:SQLStatement = new SQLStatement();
                            sql.sqlConnection = _connection;
                            var arquivo:File = new File(caminho);
                            var arqStream:FileStream = new FileStream();
                            arqStream.open(arquivo,SQLMode.READ);
                            var arqBlob:ByteArray = new ByteArray();
                            arqStream.readBytes(arqBlob);
                            arqStream.close();
                    sql.text = "INSERT INTO arq(nome, arquivo)" + 
                                "VALUES(@nome, @arquivo)";
                    sql.parameters["@nome"] = identificacao;
                    sql.parameters["@arquivo"] = arqBlob;
                    sql.execute();
                     trace("Arquivo inserido com Sucesso!!!");
                     lb1.text = "Arquivo inserido com Sucesso!!!";
                 private function selectFile(identificacao:String):void {
                             var sql:SQLStatement = new SQLStatement();
                            sql.sqlConnection = _connection;
                    sql.text = "SELECT id, arquivo FROM arq WHERE nome=@nome";
                    sql.parameters["@nome"] = identificacao;
                    trace(sql.text);
                    sql.addEventListener(SQLEvent.RESULT, apresentarDados);
                    sql.execute();
                 private function apresentarDados(event:SQLEvent):void {
                             var statement:SQLStatement = event.target as SQLStatement;
                            var result:SQLResult = statement.getResult();
                            if(result != null && result.data != null) {
                                  var dataset:Array = result.data;
                                  trace(dataset.length);
                            var arqBlob:ByteArray = dataset[0].arquivo;
                       var xx:HTMLLoader = new  HTMLLoader();
                      var ur:URLRequest = new URLRequest();
                      var ul:URLLoader = new URLLoader();
                       //Right now, it's doing nothing
    ur.contentType = "application/pdf";
                       ul.dataFormat = URLLoaderDataFormat.BINARY;
                      ul.data = arqBlob;
                       //Here is my problem - WHAT SHOULD I DO?
    pdfFile.data = arqBlob;
                           trace("Cheguei!!!");
                          lb1.text = "Cheguei!!!";
                             } else {
                                  trace("Não funcionou!!!")
                 private function sair():void {
                      this.exit();
                 ]]>
          </mx:Script>
          <mx:TextInput x="99" y="10" id="arq"/>
          <mx:Label x="10" y="12" text="Identificação:" width="81"/>
          <mx:Button x="168" y="40" label="Apresentar" click="selectFile(arq.text)"/>
          <mx:Button x="728" y="10" label="Sair" width="60" click="sair()"/>
          <mx:TextInput x="417" y="10" id="id1"/>
          <mx:TextInput x="417" y="40" id="cm1"/>
          <mx:Button x="585" y="12" label="Gravar" click="insertFile(id1.text, cm1.text)"/>
          <mx:Label x="291" y="12" text="Identificação:" width="105"/>
          <mx:Label x="291" y="42" text="Caminho Completo:" width="118"/>
          <mx:Label x="615" y="42" width="173" id="lb1"/>
          <mx:HTML id="pdfFile" width="800" height="520" y="79"/>
    </mx:WindowedApplication>

    Bob, Here's some ActionScript code for saving the byte array data to temporary file. (In this code, pdfData is a ByteArray object containing the PDF data.)
    var tempFile:File = File.createTempFile();
    var stream:FileStream = new FileStream();
    stream.open(tempFile, FileMode.WRITE);
    stream.writeBytes(pdfData);
    stream.close();
    Next you can load the file into your Flex HTML control (represented as html in the following code):
    html.location = tempFile.url;
    Here's more information on reading and writing files:
    http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7dc2. html (for Flex developers)
    http://help.adobe.com/en_US/AIR/1.5/devappsflash/WS5b3ccc516d4fbf351e63e3d118666ade46-7dc2 .html (for Flash developers)
    http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7dc2. html (for Ajax developers)

  • How to access a variable from one mxml to another mxml?

    I have Vbox having Hbox in turn hbox has some components ...TextInput...
    I m adding this Vbox in another mxml file....iteratively ....
    I need the sum of all the enetered values in the text boxes to be displayed on the textbox in another Mxml ...
    I am taking sum in a variable and want to show tha some in another file...
    How can I get that variable in my resultant mxml??
    TIA

    In this case it is best to use custom events to pass data. Here are some resources:
    http://chikaradev.com/learning/flex3/customevents/StudentsTutoringCustomEvents1.pdf
    http://chikaradev.com/learning/flex3/customevents/CustomEvents3/CustomEvents3.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=createevents_3.html
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • Noob needs help - PDF Fails to display - Only black screen

    Hi,
    I am new to FB. I was tasked with finishing up an desktop application that someone else started. They were using FB 3.
    I got the trial of FB 4.5 and imported the project. Then started the process of learning FB. I am working on a Mac.
    I got the UI fixed and a few bugs. Then exported a release build. Ran it on windows all seemed fine except for display a few PDFs.
    The PDFs all display fine on my Mac, just not on Windows. I searched all over for some clue as to what is happening. I even tried installing the latest Adobe Reader, still no change,
    The code that displays the PDFs couldn't be more simple:
    <mx:HTML x="10" y="10" width="100%" height="100%" location="appen/c5awwa.pdf" borderStyle="none"/>
    The Parent is:
    <mx:Canvas label="AWWA Standard" width="100%" height="100%" borderStyle="none">
    And whos parent is:
    <mx:TabNavigator width="100%" height="100%" borderStyle="none">
    The top level, 2nd line in files is:
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"  width="100%" height="100%"   xmlns:local="*">
    So the order is:
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"  width="100%" height="100%"   xmlns:local="*">    
         <mx:TabNavigator width="100%" height="100%" borderStyle="none">
              <mx:Canvas label="AWWA Standard" width="100%" height="100%" borderStyle="none">
                   <mx:HTML x="10" y="10" width="100%" height="100%" location="appen/c5awwa.pdf" borderStyle="none"/>
    I did notice that the canvas should not be used in favor of a BorderContainer or a Group.
    Since being totally new to this, I figured I'd get it working before I tried to chage the containers. I looked at doing that but didn't have the time to figure it out as I have a deadline, the 14th.
    We plan on buying this as we want to turn the app into a mobile app also.
    If it means anything her is the apps declaration (not sure that's what its called, the 1st line:
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
                                                                                                                            xmlns:local="*"
                                                                                                                            width="916" height="850"
                                                                                                                            backgroundColor="#EAEEF1" borderColor="#FDFDFD"
                                                                                                                            creationComplete="init()" horizontalScrollPolicy="off" verticalScrollPolicy="off" layout="absolute"
                                                                                                                            >
    If anybode has a clue, please point me in the right direction.

    I don't have any problem displaying those PDF files with Safari on either my iPad Air 2 or iPhone 5 which are both on iOS 8.1.2.
    Perhaps the problem is dependent on whatever else you are doing in the browser.

  • Can't generate PDF from xdp and XML

    Hello,
    I'm new to livecycle and flashbuilder.
    I assigned as a task to send to a  livecycle server a xdp template and a XML file with the data in order to create the pdf.
    So far, I created a class with two methods that returns as a BLOB the strings of a xdp template and the XML data to populate the template.
    On the main application I'm calling the generatePDFOutput method from the OutputService and as far as I know I'm supposed to get a Blob which I can manipulate to save it as a PDF.
    What could be my error? or how should I approach this problem? I came here since I can't find some document that shows how to create pdf from a flex app using livecycle...
    I appreaciate your help.
    I attach below the code of the main class
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="initializeChannelSet();">
        <fx:Script>
            <![CDATA[
                import flash.sampler.Sample;
                import mx.messaging.ChannelSet;
                import mx.messaging.channels.AMFChannel;
                import mx.rpc.CallResponder;
                import mx.rpc.events.ResultEvent;
                import services.outputservice.OutputService;
                import valueObjects.BLOB;
                import valueObjects.OutputResult;
                import valueObjects.PDFOutputOptionsSpec;
                import valueObjects.RenderOptionsSpec;
                private var parentResourcePath:String="/";
                private var serverPort:String="192.168.3.46:8080";
                private function initializeChannelSet():void{
                    var cs:ChannelSet= new ChannelSet();
                    cs.addChannel(new AMFChannel("remoting-amf", "http://"+serverPort+"/remoting/messagebroker/amf"));
                    outputService.setCredentials("administrator","password");
                    outputService.channelSet=cs;
                protected function btn_clickHandler(event:MouseEvent):void
                var pdf:OutputService= new OutputService();
                var x:TestPDF= new TestPDF();
                var wsCall:CallResponder= new CallResponder();
                var out:PDFOutputOptionsSpec= new PDFOutputOptionsSpec();
                out.fileURI="D:\PDF_Output\test.pdf";
                var render:RenderOptionsSpec= new RenderOptionsSpec();
                wsCall.token=pdf.generatePDFOutput("PDF","Form.xdp","D:\\PDF_Output",out,render,TestPDF.D ata());
                var res:BLOB= wsCall.lastResult as BLOB;
                var result:ByteArray= new ByteArray();
                    result=res as ByteArray;
                var a:Number=2;
                protected function outputService_resultHandler(event:ResultEvent):void
                    // TODO Auto-generated method stub
            ]]>
        </fx:Script>
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
            <mx:RemoteObject id="outputService" destination="OutputService" result="outputService_resultHandler(event);"/>
        </fx:Declarations>
        <s:Button id="btn" x="90" y="141" label="Button" click="btn_clickHandler(event)"/>
    </s:Application>

    build.xml file for Hibernate:
    <?xml version="1.0"?>
    <project name="Hibernate"
    default="schemaGenerator" basedir="C:\Hibernate">
    <property name="src.dir" value="src"/>
    <property name="classes.dir" value="classes"/>
    <property name="hibernate" value="hibernate-2.1"/>
    <property name="hibernate.mappings" value="mappings"/>
    <property name="jdbc" value="C:\oracle\product\10.1.0\Db_1\jdbc"/>
    <property name="hibernate.extensions" value="tools"/>
    <property name="hibernate.properties" value="properties"/>
    <path id="project.class.path">
    <pathelement location="${classes.dir}" />
    <fileset dir="${hibernate}">
    <include name="hibernate2.jar"/>
    </fileset>
    <fileset dir="${hibernate}/lib">
    <include name="*.jar"/>
    </fileset>
    <fileset dir="${hibernate.extensions}/lib">
    <include name="*.jar"/>
    </fileset>
    <fileset dir="${hibernate.extensions}">
    <include name="hibernate-tools.jar"/>
    </fileset>
    <fileset dir="${jdbc}/lib">
    <include name="classes12.jar"/>
    </fileset>
    </path>
    <target name="init"> <mkdir dir="${src.dir}"/>
    <mkdir dir="${classes.dir}"/>
    </target>
    <taskdef name="javaGen"
    classname="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask"
    classpathref="project.class.path"/>
    <target name="javaGenerator" depends="init">
    <javaGen output="${src.dir}">
    <fileset dir="${hibernate.mappings}">
    <include name="Catalog.hbm.xml"/>
    </fileset>
    </javaGen>
    </target>
    <target name="compile" depends="javaGenerator">
    <javac srcdir="${src.dir}"
    destdir="${classes.dir}">
    <classpath refid="project.class.path"/></javac>
    </target>
    <taskdef name="schemaGen"
    classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
    classpathref="project.class.path"/>
    <target name="schemaGenerator" depends="compile">
    <schemaGen properties="${hibernate.properties}/hibernate.properties" quiet="no">
    <fileset
    dir="${hibernate.mappings}">
    <include name="Catalog.hbm.xml"/>
    </fileset>
    </schemaGen>
    </target>
    </project>

  • Display PDF document in Flex Windows application

    Hi,
    I am creating a flex windows application using action script and mxml script.I need help in displaying a PDF document in that windows application.I tried google search it is giving me some open source projects with IFrames.But,they can be only used for browser applications(web).So,anyone please suggest me how could i accomplish this task with winows application.
    Thanks,
    adi2010

    Hi Everyone,
    I got the solution for my issue.We need to use HTMLLoader to load the PDF documents in Windows aplication for Flex.

  • Export to PDF/Excel

    Hi All,
    We are in NW2004s SP13. I have created a new modal and edited the tool bar to add the Export to PDF button. After reviewing the document Export Data From Visual composer I put the PDF formula but am getting the following error. Since our VC sits in the same server as Enterprise Portal we have created a Remote URL iview for the Web analyzer and used that PCD location in the formula, but still gives the same error.
    Could anyone please shed any thoughts on the same. I am enclosing the error message that we are getting and the formula that we are using.
    Formula: "pcd!3aportal_content!2edu.mayo.Y_MAYO!2edu.mayo.Y_iViews!2RDV!2BID_BEXWEB?QUERY=" & STORE@REPTNAME &"&BI_COMMAND_1-
    BI_COMMAND_TYPE=EXPORT&BI_COMMAND_1-EXPORT_FORMAT=PDF&BI_COMMAND_1-
    SHOW_EXPORT_DIALOG=X&BI_COMMAND_1-
    null="
    Error in compiling Flex application: Error 1002: String literal was not properly terminated
          (/usr/sap/EPD/JC07/j2ee/cluster/server0/GUIMachine_Business_Packages/ZRDVENROLLCNT_21038/FLEX_COMPILATION_FOLEDR/AAD1JO.mxml:388)
    Error 1033: ';' expected
          (/usr/sap/EPD/JC07/j2ee/cluster/server0/GUIMachine_Business_Packages/ZRDVENROLLCNT_21038/FLEX_COMPILATION_FOLEDR/AAD1JO.mxml:389)
    Error 1025: Left side of assignment operator must be variable or property.
          (/usr/sap/EPD/JC07/j2ee/cluster/server0/GUIMachine_Business_Packages/ZRDVENROLLCNT_21038/FLEX_COMPILATION_FOLEDR/AAD1JO.mxml:390)
    Error 1025: Left side of assignment operator must be variable or property.
          (/usr/sap/EPD/JC07/j2ee/cluster/server0/GUIMachine_Business_Packages/ZRDVENROLLCNT_21038/FLEX_COMPILATION_FOLEDR/AAD1JO.mxml:391)
    Error 1025: Left side of assignment operator must be variable or property.
          (/usr/sap/EPD/JC07/j2ee/cluster/server0/GUIMachine_Business_Packages/ZRDVENROLLCNT_21038/FLEX_COMPILATION_FOLEDR/AAD1JO.mxml:392)
    Error 1033: ';' expected
          (/usr/sap/EPD/JC07/j2ee/cluster/server0/GUIMachine_Business_Packages/ZRDVENROLLCNT_21038/FLEX_COMPILATION_FOLEDR/AAD1JO.mxml:393)
    Error 1205: The statement '' is incomplete.
          (/usr/sap/EPD/JC07/j2ee/cluster/server0/GUIMachine_Business_Packages/ZRDVENROLLCNT_21038/FLEX_COMPILATION_FOLEDR/AAD1JO.mxml:390)
    Error 1128: Attribute used outside class.
          (/usr/sap/EPD/JC07/j2ee/cluster/server0/GUIMachine_Business_Packages/ZRDVENROLLCNT_21038/FLEX_COMPILATION_FOLEDR/AAD1JO.mxml:393)
    Error 1128: Attribute used outside class.
          (/usr/sap/EPD/JC07/j2ee/cluster/server0/GUIMachine_Business_Packages/ZRDVENROLLCNT_21038/FLEX_COMPILATION_FOLEDR/AAD1JO.mxml:394)
    Thanks,
    Krishna

    Krishna,
    hv you ensured that ADS has been installed and configured? Am not very familiar with config of ADS, but check out note 944221 to troubleshoot this
    Also, navigate to Sdn>Wiki>VC>Modeling>Export Data
    you'll find more info regd pre-req for exporting to ADS and config dtls
    prachi

  • IE 8 "Runtime Error" trying to open PDF with Reader 9.5.1

    I've seen many variants of this problem on the forum.  Running Win7, IE 8, Firefox 14, and Reader 9.5.1.
    For some little while, I've had a problem opening PDF files from links on Webpages that I view in IE8.  I see the following Runtime Error message:
    More recently, I've seen a similar problem with Firefox 14.  The difference is that there's no error message with Firefox ... it opens a new tab, but the browser tab remains blank.
    Could the problem be from installing Reader 9.5.1 recently?  How do I back out that update, and resort to the previous version of Reader -- which ran error free?
    Thanks
    Jerry

    We created a small standalone test application, which just opens a PDF. Same issue was found, with just this one User. Here's the code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/mx"
            width="1004" height="510" backgroundColor="#000000" creationComplete="windowedapplication1_creationCompleteHandler(event)">
    <fx:Script>
      <![CDATA[
       import mx.events.FlexEvent;
       protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
        myHtml.location = "vt1_04_using_flash_builder.pdf";
      ]]>
    </fx:Script>
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <mx:HTML id="myHtml" left="10" right="10" top="10" bottom="10"/>
    </s:WindowedApplication>

  • Flex 4 - Generate PDF - AlivePDF

    Hello all.
    I am in need of creating PDF documents from a flash project.  THe flash project needs to be using the latest flex 4. And i will be sing the <s:Application> tags.
    I grabbed an example from "Tour de Flex"  but it was built using <mx:Application>. The code for this example is here
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application  xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
         viewSourceURL="srcview/index.html" backgroundColor="0x000000" layout="absolute">
        <mx:Script>
            <![CDATA[
                import org.alivepdf.pages.Page;
                import org.alivepdf.pdf.PDF;
                import org.alivepdf.layout.Orientation;
                import org.alivepdf.layout.Size;
                import org.alivepdf.layout.Unit;
                import org.alivepdf.display.Display;
                import org.alivepdf.saving.Method;
                import org.alivepdf.fonts.FontFamily;
                import org.alivepdf.fonts.Style;
                import org.alivepdf.colors.RGBColor;
                import mx.utils.UIDUtil;
                protected var claimPDF:PDF;
                [Embed(source="assets/Insuricorp-Logo.jpg", mimeType="application/octet-stream" )]
                protected var jpgBytes:Class;
                protected function savePDF(e:MouseEvent):void
                    claimPDF = new PDF(Orientation.LANDSCAPE, Unit.MM, Size.LETTER);
                    claimPDF.setDisplayMode (Display.FULL_WIDTH);
                    claimPDF.addPage();
                    claimPDF.addImageStream(new jpgBytes() as ByteArray, 5, 5, 0, 0, 1);
                    claimPDF.setFont(FontFamily.ARIAL , Style.NORMAL, 12);
                    claimPDF.addText("Claimant Name: " + this.firstName.text + " " + lastName.text,10,40);
                    claimPDF.addText("Date: " + this.date.text,10,50);
                    claimPDF.addTextNote(48,45,100,2,"Claim Filed on: " + this.date.text + " today's date: " + new Date());
                    claimPDF.addText("Policy #: " + this.policyNum.text,10,60);
                    claimPDF.addText("Contact #: " + this.contact.text,10,70);
                    claimPDF.addText(this.claimNum.text,10,80);
                    claimPDF.addText("Claim Description:",10,90);
                    claimPDF.setXY(10,95);
                    claimPDF.addMultiCell(200,5,desc.text);
                    // HERE IS HOW TO SAVE FROM FLASH PLAYER 10 OR GREATER. THIS IS USED FOR THIS SAMPLE.
                    var bytes:ByteArray = claimPDF.save(Method.LOCAL);
                    var f:FileReference = new FileReference();
                    f.save(bytes,"tourdeflex-pdf-sample.pdf");
                    // HERE IS HOW TO SAVE FROM AN AIR APP
                    var fs:FileStream = new FileStream();
                    var file: File = File.desktopDirectory.resolvePath("tourdeflex-pdf-sample.pdf");
                    fs.open(file, FileMode.WRITE);
                    var pdfBytes:ByteArray = claimPDF.savePDF(Method.LOCAL);
                    fs.writeBytes(pdfBytes);
                    fs.close();
                     // HERE IS HOW TO SAVE FROM FLEX APP RUNNING FLASH PLAYER < 10
                     /* NOTE: To save the PDF from a Flex application if running Flash Player version < 10, you need to call a server-side
                              script as the 2nd parameter of the save call. More information about this can be found here:
                              http://alivepdf.bytearray.org/?p=17
                    claimPDF.save( ethod.REMOTE, "http://alivepdf.bytearray.org/wp-content/demos/create.php", "tourdeflex-pdf-sample.pdf");*/
                protected function submitClaimNum():void
                    claimNum.text='Claim # Assigned: '+ UIDUtil.createUID();//just generate a random id for sample purposes
                    this.savePDFBtn.visible=true;
            ]]>
        </mx:Script>
        <mx:Style>
            FormItem, Label, Button {
                color: #FFFFFF;
            TextInput, DateField {
                color: #000000;
        </mx:Style>   
        <mx:Label top="10" left="10" text="Input information and press 'File Claim' to get assigned claim #, then press Save to PDF." color="0xCCCCCC"/>   
         <mx:Label fontSize="18" text="Insurance Claim Form" left="10" top="30"/>
        <mx:HBox width="100%" height="100%" top="40" left="10" color="0x000000">
            <mx:Form id="form1" width="283" height="300">
                <mx:FormItem label="First Name:">
                    <mx:TextInput id="firstName"/>
                </mx:FormItem>
                <mx:FormItem label="Last Name:">
                    <mx:TextInput id="lastName"/>
                </mx:FormItem>
                <mx:FormItem label="Date:">
                    <mx:DateField id="date" />
                </mx:FormItem>
                <mx:FormItem label="Policy #:">
                    <mx:TextInput id="policyNum" />
                </mx:FormItem>
                <mx:FormItem label="Contact #:">
                    <mx:TextInput id="contact" maxChars="12"/>
                </mx:FormItem>
            </mx:Form>   
            <mx:Canvas top="10" left="10" width="300" height="100%">
                <mx:Label text="Description:" y="2"/>
                <mx:TextArea id="desc" y="18" height="133" width="205"/>   
            </mx:Canvas>
        </mx:HBox>
        <mx:HBox top="205" left="185">
            <mx:Button label="File Claim" click="submitClaimNum()"/>
            <mx:Button horizontalCenter="0" click="savePDF(event)" label="Save to PDF" id="savePDFBtn" visible="false"/>
        </mx:HBox>
        <mx:Label id="claimNum" top="238" left="83"/>
    </mx:Application>
    SO i tried changing it to <s:Application>  but i get a load of errors saying stuff isnt supported etc etc.
    My main question is -  Does flex 4 and <s:Application> support AlivePDF or is there another way to create PDF documents?
    My code for the application where i have tried to change it to the latest flex version is as follows
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
            import org.alivepdf.pages.Page;
            import org.alivepdf.pdf.PDF;
            import org.alivepdf.layout.Orientation;
            import org.alivepdf.layout.Size;
            import org.alivepdf.layout.Unit;
            import org.alivepdf.display.Display;
            import org.alivepdf.saving.Method;
            import org.alivepdf.fonts.FontFamily;
            import org.alivepdf.fonts.Style;
            import org.alivepdf.colors.RGBColor;
            import mx.utils.UIDUtil;
            protected var claimPDF:PDF;
            [Embed(source="assets/Insuricorp-Logo.jpg", mimeType="application/octet-stream" )]
            protected var jpgBytes:Class;
            protected function savePDF(e:MouseEvent):void
            claimPDF = new PDF(Orientation.LANDSCAPE, Unit.MM, Size.LETTER);
            claimPDF.setDisplayMode (Display.FULL_WIDTH);
            claimPDF.addPage();
            claimPDF.addImageStream(new jpgBytes() as ByteArray, 5, 5, 0, 0, 1);
            claimPDF.setFont(FontFamily.ARIAL , Style.NORMAL, 12);
            claimPDF.addText("Claimant Name: " + this.firstName.text + " " + lastName.text,10,40);
            claimPDF.addText("Date: " + this.date.text,10,50);
            claimPDF.addTextNote(48,45,100,2,"Claim Filed on: " + this.date.text + " today's date: " + new Date());
            claimPDF.addText("Policy #: " + this.policyNum.text,10,60);
            claimPDF.addText("Contact #: " + this.contact.text,10,70);
            claimPDF.addText(this.claimNum.text,10,80);
            claimPDF.addText("Claim Description:",10,90);
            claimPDF.setXY(10,95);
            claimPDF.addMultiCell(200,5,desc.text);
            // HERE IS HOW TO SAVE FROM FLASH PLAYER 10 OR GREATER. THIS IS USED FOR THIS SAMPLE.
            var bytes:ByteArray = claimPDF.save(Method.LOCAL);
            var f:FileReference = new FileReference();
            f.save(bytes,"tourdeflex-pdf-sample.pdf");
            // HERE IS HOW TO SAVE FROM AN AIR APP
            var fs:FileStream = new FileStream();
            var file: File = File.desktopDirectory.resolvePath("tourdeflex-pdf-sample.pdf");
            fs.open(file, FileMode.WRITE);
            var pdfBytes:ByteArray = claimPDF.savePDF(Method.LOCAL);
            fs.writeBytes(pdfBytes);
            fs.close();
            // HERE IS HOW TO SAVE FROM FLEX APP RUNNING FLASH PLAYER < 10
            /* NOTE: To save the PDF from a Flex application if running Flash Player version < 10, you need to call a server-side
            script as the 2nd parameter of the save call. More information about this can be found here:
            http://alivepdf.bytearray.org/?p=17
            claimPDF.save( ethod.REMOTE, "http://alivepdf.bytearray.org/wp-content/demos/create.php", "tourdeflex-pdf-sample.pdf");*/
            protected function submitClaimNum():void
            claimNum.text='Claim # Assigned: '+ UIDUtil.createUID();//just generate a random id for sample purposes
            this.savePDFBtn.visible=true;
            ]]>
        </fx:Script>
        <mx:Label top="10" left="10" text="Input information and press 'File Claim' to get assigned claim #, then press Save to PDF." color="0xCCCCCC"/>   
        <mx:Label fontSize="18" text="Insurance Claim Form" left="10" top="30"/>
        <mx:HBox width="100%" height="100%" top="40" left="10" color="0x000000">
            <mx:Form id="form1" width="283" height="300">
                <mx:FormItem label="First Name:">
                    <mx:TextInput id="firstName"/>
                </mx:FormItem>
                <mx:FormItem label="Last Name:">
                    <mx:TextInput id="lastName"/>
                </mx:FormItem>
                <mx:FormItem label="Date:">
                    <mx:DateField id="date" />
                </mx:FormItem>
                <mx:FormItem label="Policy #:">
                    <mx:TextInput id="policyNum" />
                </mx:FormItem>
                <mx:FormItem label="Contact #:">
                    <mx:TextInput id="contact" maxChars="12"/>
                </mx:FormItem>
            </mx:Form>   
            <mx:Canvas top="10" left="10" width="300" height="100%">
                <mx:Label text="Description:" y="2"/>
                <mx:TextArea id="desc" y="18" height="133" width="205"/>   
            </mx:Canvas>
        </mx:HBox>
        <mx:HBox top="205" left="185">
            <mx:Button label="File Claim" click="submitClaimNum()"/>
            <mx:Button horizontalCenter="0" click="savePDF(event)" label="Save to PDF" id="savePDFBtn" visible="false"/>
        </mx:HBox>
        <mx:Label id="claimNum" top="238" left="83"/>
    </s:Application>
    If anyone can help that would be great

    Flex 4 supports alive pdf generation.
    Follwing is the sample code of generating pdf.
    var newPDF:PDF =
    new PDF(Orientation.LANDSCAPE, Unit.MM, Size.LETTER);newPDF.setDisplayMode (Display.FULL_WIDTH);
    newPDF.addPage();
    newPDF.setFont(FontFamily.ARIAL , Style.BOLD, 18);
    newPDF.addText(
    "TITLE" ,100,10);newPDF.setFont(FontFamily.ARIAL , Style.NORMAL, 16);
    newPDF.setXY(10,95);
    newPDF.addImage(orderDG,50,20);
    newPDF.addText(
    "TEST 1 " ,50,120);newPDF.addText(
    "TEST 2 ",150,120); 
    var fileREf:FileStream = new FileStream();var file:File = File.applicationStorageDirectory.resolvePath('Test.pdf');
    var stream:FileStream = new FileStream()
    stream.open(file,FileMode.WRITE);
    stream.writeBytes(newPDF.save(Method.LOCAL));
    stream.close();

  • PDF from HTMLLoader is Not Displaying in a Container

    PDF from HTMLLoader is Not Displaying in a Container
    Was there a new version of AIR released recently that breaks the display of a PDF through the HTMLLoader?
    I've been experiencing problems displaying a PDF in a container lately.
    AIR applications that worked a couple weeks ago, are not working now even though no changes have been made to the source.
    To focus on the problem, I created an application that narrows my focus to the broken feature. It's sole purpose is to display a simple PDF through AIR.
    The example can be found here.
    http://www.appfoundation.com/blogs/giametta/2009/04/14/render-pdf-in-adobe-air-with-pdf-sc aling/
    The code used is exactly the same as the one found in the above example, except I swapped the url of the PDF to the following.
    http://www.sfbike.org/download/map.pdf
    It's pretty straightforward.
    But, when I compile and press the "do it" button, nothing displays in the VBOX.
    Using an HTTP Sniffer the "GET" to my url seems to be working fine and, I get a "200 OK" return status, but nothing is displayed in the container.
    Here is my configuration.
    - Windows Vista Ultimate 64 bit
    - AIR 1.5
    - Flex 3.0.2
    - Adobe Acrobat 9 Pro
    - Firefox 3.5.4
    Attached is the source code mxml as a txt.

    Well, like I said, I don't either. Even when loading a very simple PDF, I just see this crash:
    Process:         adl [1003]
    Path:            /Users/base/c_languages/flashplayer/flex_sdk_4.0.0.10079/bin/adl
    Identifier:      adl
    Version:         ??? (???)
    Code Type:       X86 (Native)
    Parent Process:  FlashBuilder [217]
    Date/Time:       2009-11-04 11:41:13.050 -0800
    OS Version:      Mac OS X 10.6.1 (10B504)
    Report Version:  6
    Interval Since Last Report:          1807020 sec
    Crashes Since Last Report:           7
    Per-App Crashes Since Last Report:   4
    Anonymous UUID:                      E63961B9-2C86-42EA-9FBA-0D3F0561CBB8
    Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x0000000040918216
    Crashed Thread:  0  Dispatch queue: com.apple.main-thread
    Maybe someone on the AIR team will have a more knowledgable response, it looks like a problem with how Webkit is loading up the PDF viewer perhaps.

  • Display PDF from flex windows application

    Hi,
    I am creating a flex windows application using action script and mxml script.I need help in displaying a PDF document in that windows application from a netwrok drive or local pc.I tried google search it is giving me some open source projects with IFrames.But,they can be only used for browser applications(web).So,anyone please suggest me how could i accomplish this task with winows application.
    Thanks,
    adi2010

    Hi ,
    The solution for the thread is
    <mx:HTML id="pdfHtml" location="test.html" width="100%" height="100%" />
    var pdfFile:File = File.applicationDirectory.resolvePath(pdfHtml.location);
        pdfFile = new File(pdfFile.nativePath);
        var fileURL:String = pdfFile.url;
        pdfHtml.location = fileURL;
    Thanks,
    adi2010.

Maybe you are looking for

  • The standard report for BOMs of a material with a selected period?

    Hi Gurus Is there any  standard report for BOMs of a material with a selected period?

  • Web Dynpro application Session time expired in Portal

    Hi All ,    I am runnnig my web dynpro application in portal. When i log in for first time its working fine. But if if lof off and try to log in again in portal in same browser and try to access that web dynpro application then i am gettting error as

  • IPod Nano Gen 7 won't respond to *anything*.

    I have a 7th Generation iPod Nano that's worked flawlessly until today, when it won't turn on or respond to being plugged into anything. I've tried using two different iPod USB cords (one that also worked flawlessly until today and a backup one that

  • How to reduce number of colors in an image

    I am fairly new to Photoshop and I'm learning as I go, so I apologize for using your time.  I haven't worked with images that much - I've used MS Digital Image Suite with photos from my camera.  That's the extent of my knowledge. I am taking over a j

  • Dynamically retreiving fields of a table

    Hi, I have a text file in the application server containing data corresponding to the fields of table EPROVAL15.I have declared an internal table and work area of the table type .While I am trying to split the file into respective fields it's throwin