6 Replies Latest reply on Aug 6, 2010 12:24 AM by Narayan S S

    PDF opens at second page in HTMLLoader

    Narayan S S



      I created an offline AIR application to browse and view our product manuals.When the user selects a pdf, HTMLLoader displays the pdf in a pane. Things were working as designed in AIR 1.5. When we updated the runtime to AIR 2.0, the pdf opens in the second page instead of the first page. Frustrating situation since the second page is the copyright page and users get annoyed by all the little sentences which are hard to read. Issue still exists in 2.0.2.

        • 1. Re: PDF opens at second page in HTMLLoader
          chris.campbell Adobe Employee


          Is it possible to get some sample code that displays this behavior?  I just tried with the following code with 2.0.2 and was unable to reproduce the problem.





          <?xml version="1.0" encoding="utf-8"?>
          <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                    <!-- Place non-visual elements (e.g., services, value objects) here -->
                         import mx.core.UIComponent;
                         private function init():void
                              if(HTMLLoader.pdfCapability == HTMLPDFCapability.STATUS_OK) 
                                   var request:URLRequest = new URLRequest("http://www.adobe.com/products/acrobat/pdfs/pdfaccess.pdf");
                                   var pdf:HTMLLoader = new HTMLLoader();
                                   pdf.height = 800;
                                   pdf.width = 600;
                                   var container:UIComponent = new UIComponent();
                                   addElement( container );
                                   // displayObject goes to container
                                   var displayO:Sprite = new Sprite();
                                   container.addChild( pdf );
                                   trace("PDF cannot be displayed. Error code:", HTMLLoader.pdfCapability);

          • 2. Re: PDF opens at second page in HTMLLoader



            I also have this same problem and it started when moving to AIR 2.0. In my case there are a couple of extra clues.

            • It happens with local content that ends up using a "file:" protocol.
            • It happens on multiple machines for different users.
            • The same file loaded several times in a row (each with a new instance of the HTML component) will display page 2 most but not every time.
              • The really odd thing is that the pattern is not repeatable even when closing and reopening the application.
            • Some files exhibit the problem regularly and others do not as if there is something different about the PDF content.
            • I cannot repeat the problem when opening the same files in the standalone Adobe Reader or FireFox browser.
            • The scrollv property is set at 0 even while displaying page 2.


            I hope that helps because it is an annoying problem.




            1 person found this helpful
            • 3. Re: PDF opens at second page in HTMLLoader
              chris.campbell Adobe Employee

              Hi Rick,

              Thanks for the extra data points!  Is it possible to get a copy of the pdf's that encounter this problem?  Please feel free to email me at ccampbel@adobe.com with any samples (pdf, code, and/or compiled air app) you can provide.




              • 4. Re: PDF opens at second page in HTMLLoader
                Narayan S S Level 1

                Hi Chris,


                I have sent you the code and a sample pdf. Thanks for  your time.



                • 5. Re: PDF opens at second page in HTMLLoader
                  chris.campbell Adobe Employee

                  Thank you guys for the sample code and pdf's.  I've been able to reproduce this on Windows (25 - 50% of the time.)  I've been unable to repro on Mac, please let me know if you see it there too.  I've added an internal bug (#2685024) with a link back to this post for further investigation.




                  1 person found this helpful