3 Replies Latest reply on Mar 19, 2010 10:30 AM by Peter deHaan

    Trying to render a PDF in Gumbo - bizarre behaviour with HTML objects

    Matt_Voerman

      Hey guys,

      I'm going crazy here trying to get a PDF to render in Gumbo. I have no problems doing it in Flex 3.x but Flex 4.x is giving me some very odd results.

       

      My HTML code (test.html) looks like this

                              

       

      my Gumbo code looks like this, and renders NOTHING....

       

       

      My Flex 3.x code looks like this, and works fine....

       

       

      BUT!! If I programatically add an HTML object (in Flex 4.x) and try and render the HTML/PDF it - the HTML/PDF renders?!

       

       

      Any ideas why I can't manually add an MXML flavoured HTML object and have it render in Flex 4.x?

        • 1. Re: Trying to render a PDF in Gumbo - bizarre behaviour with HTML objects
          David_F57 Level 5

          Hi,

           

          I'm thinking there was supposed to be some sort of attachments to this post, would you like to try again so we can help with the problem..

           

           

          David

          • 2. Re: Trying to render a PDF in Gumbo - bizarre behaviour with HTML objects
            Matt_Voerman Level 1

            Hey David,

            Yeah for some reason the post decided not to attach/post my code...


            The problem is that when I try and render an HTML page with an an embedded PDF object (via an MXML instantiated HTML object) within Gumbo nothing gets rendered - yet if I use Flex 3, the both HML/PDF render fine!


            To recreate - create an HTML page that points to a PDF - like thus

             

            <html>
            <title>PDF Test</title>
                    <object id="PDFObj"
                            data="test.pdf"
                            type="application/pdf"
                            width="100%"
                            height="100%">
                    </object>
                </body>
            </html>

             

             

            Then create a basic Gumbo app that loads the above HTML via a standard (MXML instantiated) HTML object - a'la

             

            <?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/halo">
                <fx:Declarations>
                    <!-- Place non-visual elements (e.g., services, value objects) here -->
                </fx:Declarations>
                <mx:HTML id="myHTML" width="800" height="600" location="test.html" horizontalCenter="0" top="10"/>
            </s:WindowedApplication>

             

            NOTHING is rendered !?

             

            BUT....If I try and render the same HTML/PDF using a dynamically instantiated HTML Object using the code below - the HTML/PDF are rendered!!

             

            <?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/halo"
                                    creationComplete="init()">
                 <fx:Declarations>
                     <!-- Place non-visual elements (e.g., services, value objects) here -->
                 </fx:Declarations>
                 <fx:Script>
                     <![CDATA[

                         import mx.controls.HTML;

                         private function init():void
                         {

                            var htmlContainer:HTML = new HTML();
                             htmlContainer.location = "test.html";
                             htmlContainer.horizontalCenter = 0;
                             htmlContainer.top = 10;
                             htmlContainer.width = 800;
                             htmlContainer.height = 600;
                            
                             this.addElement(htmlContainer);
             
                         }
                     ]]>
                 </fx:Script>
            </s:WindowedApplication>

             

            So i'm wondering if this is a bug, or if Gumbo now has a new way of instantiating MXML based HTML objects that i'm missing.


            It's also worth keeping in mind, that this works as expected in Flex 3.x (i.e. caling the MXML instantiated HTML Object renders A-OK)

            • 3. Re: Trying to render a PDF in Gumbo - bizarre behaviour with HTML objects
              Peter deHaan Level 4

              @Matt,

               

              I assume you're using the latest Flex 4 nightly build (and not beta 2 or something), but can you please file a bug at http://bugs.adobe.com/flex/ and attach your simple test case(s) and somebody at Adobe can take a look.

               

              Thanks,

              Peter