PDFs in a Flex App.!

Hello everyone,
I am building an app. where the user can load and display a PDF file.  I`ve read (in a different Adobe forum) that this can only be done in an AIR app. because Flash apps. can only interpret/display a limited set of HTML tags.  However, after a little searching I found this article (by an Adobe Flex engineer):
http://raghuonflex.wordpress.com/2006/12/07/flex-i-frame/
Has any support for displaying PDFs been added to Flex 4, or is this solution the best/only way to go?
Thanks in advance for any help anyone can give!
Matt

Here is a quick example of a HTTPService to capture an XML
file. I created a simple Alert to show one way to access the XML
element you are trying to get. Obvioulsy there are many ways to
traverse XML, but this should get you started.
If you are still confused, try posting your actual code, and
I can modfiy it.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="customersRPC.send();">
<mx:Script>
<![CDATA[
import mx.collections.*;
import mx.controls.*;
import mx.rpc.events.*;
import mx.events.*;
[Bindable]
private var customers:ArrayCollection = null;
private function customersRPCResult(event:ResultEvent):void
customers = new ArrayCollection();
customers = event.result.customers.person as
ArrayCollection;
Alert.show(event.result.customers.person[0].first);
// Fault handler - displays the error
private function
customersRPCFaultHandler(event:FaultEvent):void
Alert.show(event.fault.message, "Could not load
customers.php XML");
]]>
</mx:Script>
<mx:HTTPService
id="customersRPC"
showBusyCursor="true"
url="
http://127.0.0.1/Test1/bin/customers.php"
result="customersRPCResult(event);"
fault="customersRPCFaultHandler(event);"/>
</mx:Application>

Similar Messages

  • Generate PDF from existing flex app

    Hi all,
    Is there a way that i can generate a pdf file based on the
    existing flex application? For example, if i have a VBox called
    "my_vbox" and it contains some child elements, so how can i simply
    create a pdf that contains all my_vbox's content?
    Currently i only have a dummy solution that to print the
    template and use Acrobat Professional to convert it, e.g.
    var printJob:FlexPrintJob = new FlexPrintJob();
    if (printJob.start() != true) return;
    printJob.addObject(my_vbox, FlexPrintJobScaleType.SHOW_ALL);
    printJob.send();
    So is there a solution that as easy as this one to "print" my
    whole template into a pdf? I have tried AlivePDF but it doesn't
    support pdf creation from IUI component(s).
    Thanks in advance!

    Hi,
    Have you tried the addImage() method of AlivePDF? It takes a
    DisplayObject as input:
    public function addImage(pDisplayObject:DisplayObject,
    pAlpha:Number = 1, pBlend:String = "Normal", pMatrix:Matrix = null,
    pResizePage:Boolean = false, pEncoding:String = "JPG",
    pQuality:Number = 100, pX:Number = 0, pY:Number = 0, pWidth:Number
    = 0, pHeight:Number = 0, pLink:String = ""):void
    More info
    here

  • Embedding swf/parts of flex app in pdf

    Hi,
    We want to be able to export to pdf in our flex app.  I know alivePDF among others do this.  However, we want to take the extra step to be able to embed flex into the pdf itself - making the pdf interactive and not just a report.  Is there a third party library that someone can recommend that can do this?  I believe lifecycle services does this, but we don't have a license.
    Thanks in advance.

    You must use the 3.4.1 SDK that is provided on LiveCycle DVD or from an installation of Workbench (See the Customizing LiveCycle Workspace ES2 at at  http://help.adobe.com/en_US/livecycle/9.0/customizeworkspaceui.pdf or the Creating Flex applications enabled for LiveCycle Workspace ES2 guide http://help.adobe.com/en_US/livecycle/9.0/createflexapps.pdf guide).
    There are functions in the SwfConnector component that allows you to communicate with the IFrame but as far as I know, there are no APIs that are exposed.
    I'll defer to others if they know about it.
    Hope that helps!

  • Generating PDF with Flex App (swf) embedded

    Hi,
    Does anyone has the experience in developing a Flex Application that is to be
    embedded into a PDF and open in the Reader/Acrobat for data capturing?
    How to embed the Flex Application (swf) into a PDF in a Livecycle process?
    With the XML data prepopulated into the PDF (embedded with a schema) and
    accessible by the Flex Application when open in Reader/Acrobat.
    Users will still be able to save the data filled in the Flex Application into the PDF
    and also to generate a XML data (with data capturing in the Flex App) to be
    submitted back to the server.
    How can these be achieve? Any example?
    Thanks alot.

    Just wondering, am I in the correct section of the forum? it seems like most of the discussions listed here are related to form designing rather than form rendering.
    I know this is FORMS ES section, just that i come across something that might related to the topic.
    Has anyone try out Adobe LiveCycle PDF Generator ES2 new features?
    Based on Adobe Upgrade Center http://www.adobe.com/products/livecycle/upgrade/pdfgenerator.html, it mentioned that PDF Generator ES2 has the ability to embed SWF files in PDF.
    But is this also applicable to Flex Application compiled SWF file?
    Does the generated PDF function as a normal interactive form?
    Able to retain its embedded schema and objects (scripts)?
    I will try to install LC ES2 to try out but need sometime to setup the system, really appreciate if someone can give me a head start.
    Thanks.

  • How do I add a book(pdf) into my Kobo app on my iPhone

    How can I add books that I want to read to my Kobo app on my iPhone?
    How do I add some of my videos into my flex player app or my iMedia player app? If I do add a video which will it play under?

    Connect the phone to your computer and click on its icon in your computer's iTunes to select it. Then select the phone's Apps tab, and scroll down the screen to the 'file sharing' section - select the Kobo app on the left-hand side of that part of the iTunes screen, and on the right-hand side add the PDF(s) to the app. Or if the PDFs or epubs are on a website then you might be able to use 'open in' in Safari to copy them to it
    If those other apps support the file sharing section then you should be able to use the above to copy videos into them from your computer (you won't be able to play iTunes purchased videos in them ).

  • Open pdf file in flex

    Hi Guys,
    I want to open pdf file in Flex (Web Application). I am unable to open it, Please guide and help me.
    Thanks in advance..
    Rangrajan.

    Rangrajan,
    If you have the complete URL to the file; for example http://forums.adobe.com/filename.pdf
    or C:\users\yourname\filename.pdf
    Although I have not used it, you can pass the URL to Drumbeat Insight iFrame
    You can try their product, get prices for source code or library here: http://drumbeatinsight.com/products
    They offer email support for their products.
    You can make your own iFrame, with several sources.  Here is some background.
    http://www.ozzu.com/flash-forum/targeting-iframe-from-flash-t30013.html
    Let me know if this solves your file issue.
    I need to write a server-side app to listen to my web service, upload the PDF, then write a temporary file.pdf to the server,
    before my web app can load the PDF into a web hosted iFrame.
    Adobe needs to make this easy (and I even know some developers in the San Jose Adobe headquarters).
    Bruce

  • Flex app calling CF cfc to download file gets "Channel disconnected" fault

    I am a newbie with ColdFusion and Flex. I am trying to implement file download/streaming functionality in my Flex 4.5 application and I am running ColdFusion 9 as my back end. More specifically, I have a component in my Flex app that displays a list of files - some of these files can be available for opening (or "previewing") via the client. I want the client to be able to click a button and download the file from the ColdFusion server, after the appropriate security checks are performed (also in ColdFusion). Right now I am just trying to get the basic download functionality to work with a very simple cfc. Here is the cfc code:
    <cfcomponent displayname="Preview Document"
         output="false">
         <cffunction name="streamFile" access="remote" returntype="any">
              <cfargument name="filename" displayName="Filename" type="string" required="true" />
              <cfheader name="Content-Disposition" value="attachment;filename=#filename#" >
              <cfcontent type="application/unknown" file="c:\myserverpath\#filename#">
         </cffunction>
    </cfcomponent>
    When I try this via a cfm, it works fine (I get a File Download window where I can choose to either open or save the file). But when I try to use this in my Flex app, I get an error.
    In my Flex app, I have a RemoteObject to access my cfc and a CallResponder:
    <s:RemoteObject id="PreviewDocument"
       source="PreviewDocument"
       destination="ColdFusion"
       showBusyCursor="true"/>
      <s:CallResponder id="PreviewDocumentResult"
        fault="Alert.show('CallResponder PreviewDocumentResult: ' +
        event.fault.faultString + '\n' + event.fault.faultDetail)"
        result="PreviewDocumentResult_resultHandler(event)"/>
    Then I created a button whose click even executes the following line:
    PreviewDocumentResult.token = PreviewDocument.streamFile("myfile.pdf");
    When I run my app, I get the following fault:
    faultCode = "Client.Error.DeliveryInDoubt"
    faultString = "Channel disconnected"
    faultDetail = "Channel disconnected before an acknowledgement was received"
    I have tried many different approaches and searched online for help with this fault, but I could not find any helpful clue to where I can start investigating this.
    Can anyone help with why I am getting this fault?
    Thanks in advance.

    @sir_teddy, thanks for your reply again.
    Yes I have created a simple cfc that returns a string successfully (in fact I had used the same cfc and basically just commented out the cfcontent and cfheader tags, and returned the name of the file being requested in the cfreturn tag). When I un-comment the cfcontent tag from the code, the error comes back.
    So I am really at a loss here...

  • How to render a pdf file within flex

    Hi,
    could any one suggest, how to open a pdf file within flex.
    we have an application built on flex3.
    please suggest.
    regards,
    John

    Hi,
    Is it a Flash or AIR app?
    If it's an AIR app, then use the HTML/web, where you then can navigate to the URL of your PDF.
    If it's an Flash app, then set the wmode to transparent: http://kb2.adobe.com/cps/127/tn_12701.html#main_Using_Window_Mode__wmode__values_
    And then create an iframe in your HTML page, where you load you PDF, set the iframe z-index, so it gets shown on top of the Flash object. Then you kan use the javascript bridge to interact with the iframe.
    Best regards
    Martin

  • Running Flex app in Linux

    Hi all,
    I've got a strange problem on Linux (Ubuntu 8 running in
    VMware): I've got a quite complex Flex application running in FP
    10.0.12.36 where (in both Opera and Firefox)
    - the "Settings" link in the FP context menu is greyed out
    - the Settings popup does not appear when the Flex app tries
    to save more data in a SharedObject than currently allowed for this
    domain
    - the Settings popup window does not appear when deliberately
    triggered (via Security.showSettings)
    With another simple Flex test application running in the same
    OS as the same user in the same browsers, all these problems don't
    appear. The only difference which I can see at the moment (apart
    from the complexity of the application which of course shouldn't
    play a role) is that the complex application is compiled from an
    Ant task whereas the simple app is created and compiled inside Flex
    builder.
    I did not deliberately set anything in the Ant task which
    could avoid the "settings" issue to work properly. In the Flex
    compiler options I also can't see anything related to these
    settings.
    Does anyone have had a similar problem? Any clues or
    suggestions?
    btw: here is the Ant task:
    <target name="compile_annex_flex_files"
    depends="checkFlexHome">
    <echo>Compile: start</echo>
    <echo>FLEX_HOME: ${FLEX_HOME}</echo>
    <mxmlc file="${ANNEX_SOURCES_DIR}/AnnexInterface.mxml"
    output="${ANNEX_OUTPUT_DIR}/AnnexInterface.swf"
    locale="en_US" debug="false" use-network="true"
    static-rsls="false">
    <load-config
    filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
    <runtime-shared-library-path
    path-element="${FLEX_HOME}/frameworks/libs/framework.swc">
    <url
    rsl-url="${SERVER_PATH}/framework_${FLEX_BUILD}.swz"/>
    <url
    rsl-url="${SERVER_PATH}/framework_${FLEX_BUILD}.swf"/>
    </runtime-shared-library-path>
    <compiler.source-path path-element="src"/>
    <compiler.library-path dir="${basedir}" append="true">
    <include name="lib/scrollbar.swc"/>
    </compiler.library-path>
    </mxmlc>
    <echo>Compile: end</echo>
    </target>
    Thanks,
    Thomas

    You must use the 3.4.1 SDK that is provided on LiveCycle DVD or from an installation of Workbench (See the Customizing LiveCycle Workspace ES2 at at  http://help.adobe.com/en_US/livecycle/9.0/customizeworkspaceui.pdf or the Creating Flex applications enabled for LiveCycle Workspace ES2 guide http://help.adobe.com/en_US/livecycle/9.0/createflexapps.pdf guide).
    There are functions in the SwfConnector component that allows you to communicate with the IFrame but as far as I know, there are no APIs that are exposed.
    I'll defer to others if they know about it.
    Hope that helps!

  • I have created a PDF and password protected it for view. However, when reading the PDF in Adobe Reader app on the iPad the commenting and annotation options are not available. Is there a way to allow commenting and annotation in the app while password pro

    I have created a PDF and password protected it for view. However, when reading the PDF in Adobe Reader app on the iPad the commenting and annotation options are not available. Is there a way to allow commenting and annotation in the app while password protecting the document?

    Is there a setting that needs to be set to allow the annotation features?  I set password protection to open and then password for editing and set it to Any except page extraction, but it still did not give the annotation option

  • Flex app doesn't work when moved from original location

    I'm trying to make an image gallery in flex. It works when I run it in Flex Builder perfectly fine. The html and swf files from the bin-debug folder work perfectly fine when opened in any browser also, but ONLY when those files and all related files are opened from the default location that the application was built in. When I export a build to a different folder, the swf loads but none of the information from the xml file displays. I tried setting all of the paths of the reference files (namely the xml) in the flex app to the exact absolute location on the server, and it still didn't work when I uploaded it to the server.
    I've tried several approaches starting from scratch and they have all come up with the same issue. I'm working with an educational license for Flex Builder, I'm not sure if they jip you on those and ruin the compiled swf.
    Please help! I'm losing my mind over this.I think it has to do with something else besides the code since it works fine when I hit "Run", but if anyone thinks it will help to post the code let me know.

    when you build an application using one of the wizards (like coldfusion flex application wizard) it hard codes
    paths to cold fusion CFC's, and sometimes gets it wrong.
    If your application references cfc's (or other remote objects) then it may be necessary to adjust the flex code
    when moving the code into a different base folder.
    For example in my own application, the url is http://localhost/crm_dev_flex and the built application gets put into
    c:\inetpub\wwwroot\crm_dev_flex\bin-debug
    References in the code to components found in c:\inetpub\wwwroot\crm_dev_flex\bin-debug\components\cfgenerated
    (in the flex code these looks like crm_dev_flex.bin-debug.components.cfgenerated.<mycomponent> )
    These need to change when you move the code to somewhere else.
    Also, if you are using wizard generated cfc's then these also contain similar references that need to be changed.
    IHTH.
    Cheers

  • File not Found Error in Flex APP-MDI

    Hi Friends,
    In my Flex APP-MDI application  have error.Th error is given blew.How can i solve this problem,please any one help to me.
    Error:
    File not found: file:/C:progmfiles/AdobeFlashBuilderBeta2/amdiBasicExample_1_1_1/bin-debug/amdiBasicExamp le.html
    Thanks,
    Magesh R.

    You would do better to ask this in the developer forum, not the user forum.

  • I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build.  The same call works fine when running on the device

    I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build. The same call works fine when running on the device (iPhone) using debug build. When running with a release build, the result handler is never called (nor is the fault handler called). Viewing the BlazeDS logs in debug mode, the call is received and send back with data. I've narrowed it down to what seems to be a data size issue.
    I have targeted one specific data call that returns in the String value a string length of 44kb, which fails in the release build (result or fault handler never called), but the result handler is called as expected in debug build. When I do not populate the String value (in server side Java code) on the object (just set it empty string), the result handler is then called, and the object is returned (release build).
    The custom object being returned in the call is a very a simple object, with getters/setters for simple types boolean, int, String, and one org.23c.dom.Document type. This same object type is used on other other RemoteObject calls (different data) and works fine (release and debug builds). I originally was returning as a Document, but, just to make sure this wasn't the problem, changed the value to be returned to a String, just to rule out XML/Dom issues in serialization.
    I don't understand 1) why the release build vs. debug build behavior is different for a RemoteObject call, 2) why the calls work in debug build when sending over a somewhat large (but, not unreasonable) amount of data in a String object, but not in release build.
    I have't tried to find out exactly where the failure point in size is, but, not sure that's even relevant, since 44kb isn't an unreasonable size to expect.
    By turning on the Debug mode in BlazeDS, I can see the object and it's attributes being serialized and everything looks good there. The calls are received and processed appropriately in BlazeDS for both debug and release build testing.
    Anyone have an idea on other things to try to debug/resolve this?
    Platform testing is BlazeDS 4, Flashbuilder 4.7, Websphere 8 server, iPhone (iOS 7.1.2). Tried using multiple Flex SDK's 4.12 to the latest 4.13, with no change in behavior.
    Thanks!

    After a week's worth of debugging, I found the issue.
    The Java type returned from the call was defined as ArrayList.  Changing it to List resolved the problem.
    I'm not sure why ArrayList isn't a valid return type, I've been looking at the Adobe docs, and still can't see why this isn't valid.  And, why it works in Debug mode and not in Release build is even stranger.  Maybe someone can shed some light on the logic here to me.

  • How to display pdf file in flex application

    hi,
    I am Ibran, I am using Flex4.5, in that i want to display a pdf file like images.
    How can i do it please anyone tell me.
    I have used navigateToURL(url),but this was going into navigation and i can't see my textfield and buttons.
    So without this  navigateToURL(url) how can i display a pdf file in flex without navigation so that i can see my textInputs and buttons.

    Flash does not have the ability to load/display/manipulate PDF files, so you can't open it directly in the flex application.  With clever HTML and javascript, you can make it appear that it is in the same window, but it will actually be in a separate window/div in the browser.  And yes, this has always seemed absurd to me that Adobe doesn't support PDF's......
    Mark

  • Why icannot export pdf file from other app to ibook (after update today)?. Please correct my problem. iPad 2, iOS 5.0.1

    Why icannot export pdf file from other app to ibook (after update today)?. Please correct my problem.
    iPad 2, iOS 5.0.1

    Why icannot export pdf file from other app to ibook (after update today)?. Please correct my problem.
    iPad 2, iOS 5.0.1

Maybe you are looking for

  • Problems performing offset null and shunt calibration in NI PXI-4220

    I am using a 350 ohm strain gage for the measurements, i have already create a task in MAX, when i want to perform offset null in the task, the program shows a waiting bar and the leds in the 4220 board start to tilting, but when the waiting bar stop

  • My source file does not stay in the same order when imported to Target

    Hi Gurus, I am importing a file using the LKM to SQL to a target datastore on Oracle. I am using the IKM SQL Control Append but my problem is in my target datastore the order that the flat file is in is not longer together. I added a ROWNUM column an

  • Setting the sql statement

    http://www.egbolig.dk/drift_bo_syd.rpt (HERE IS THE REPORT) We are using SAP Crystal Report .NET Runtime files (http://scn.sap.com/docs/DOC-7824 newest version 13.0.9.1312) in our web asp.net application. Everything have been working fine, but we hav

  • Groupable Row header - not working

    Hi, I tried downloading the source form here and tried executing it. http://quicktable.org/jtable/quicktablemain.htm But it doesnt seem to run. But all i get is a: init: deps-jar: compile-single: run-single: java.lang.StackOverflowError Exception in

  • IPhone crashes when opening certain apps

    My iPhone crashes whenever I open the Mail, YouTube, Safari, Stocks, iTunes, App Store, and iPod apps, my iPhone instantly exits the app. This also happens when I tap on the "clear cookies" option in settings. So far it does not appear to affect any