3 Replies Latest reply on Aug 11, 2010 11:26 AM by stephanoc

    Can I print an HTMLLoader with a PDF inside it?

    stephanoc

      Oregon Health and Science University is having me create a application for a health fare that will be available to all age groups.

       

      I'm using AlivePDF to create a PDF file, then save it to the desktop. I can then use an HTMLLoader to display my lovely PDF file.

       

      Now, the print button in Adobe Reader works fine. However, there will be young children using the app, so I'd like to have a big "Print" button right above it.

       

      I figured I could just start up a print job and feed it my HTMLLoader. Am I doing something wrong here, cause I can't seem to get any output?

       

      note: variable "stuff" below is my HTMLLoader. I also have access to the PDF file if that comes in handy.

       

      private function print():void
      {
         
      var myPrintJob:PrintJob=new PrintJob();
         
      var result:Boolean=myPrintJob.start();
         
      if (result && stuff != null)
         
      {
             
      var rect:Rectangle=new Rectangle(0, 0, 2550, 3300);
             
      var opt:PrintJobOptions=new PrintJobOptions(true);
              myPrintJob
      .addPage(stuff, rect, opt);
              myPrintJob
      .send();
         
      }
         
      else
         
      {
             
      //User does not have printer or user canceled print action
         
      }
      }