3 Replies Latest reply on Jan 9, 2011 9:28 AM by markerline

    printing swf error (no alpha channel?)

    markerline Level 4

      Hi,

       

      I don't know if this has been covered before but I have tried the following:

       

      Printing to PDF via the print menu from the swf

      and

      Printing to paper via the print menu from the swf

       

      In both cases, the images that are on screen are PNGs created as a PNG sequence from After Effects.  They contain alpha channels and the background of the swf is non-white.  However the bounding box of the image gets printed as white, so I have  a sequence of overlapping white regions, some of which occlude the image beneath.  With alpha channels on the monitor, this is not apparent, but when on paper or in PDF format the occlusion is clear.  I don't mind the white background; however I cannot deal with the occlusion.  How can I solve this?

       

      Sincerely,

      -markerline

        • 1. Re: printing swf error (no alpha channel?)
          kglad Adobe Community Professional & MVP

          enable the printAsBitmap printjoboptions of the addPage() method.

          • 2. Re: printing swf error (no alpha channel?)
            markerline Level 4

            Eureka!! That works better than a vacuum cleaner.  Only problem is I was using the AS3 reference and some of the PrintJob examples that were listed threw errors so I had to use the final example:

             

            package 
            { 
                import flash.printing.PrintJob; 
                import flash.display.Sprite; 
             
                public class BasicPrintExample extends Sprite 
                { 
                    var myPrintJob:PrintJob = new PrintJob(); 
                    var mySprite:Sprite = new Sprite();
                    mySprite.graphics.beginFill(0x336699);
                mySprite.graphics.drawCircle(100, 100, 50);
             
                    public function BasicPrintExample() 
                    { 
                        if (myPrintJob.start()) {
                        try {
                            myPrintJob.addPage(mySprite);
                        }
                        catch(e:Error) {
                            // handle error 
                        }
                        myPrintJob.send();
                    } 
                } 
            }

             

             

            I did away with the package and the class and just called the function as a mouse event for a print-button.  I'm not sure why the if(myPrintJob.start()) call works because nowhere am I declaring the print job to start.  I guess that's something that happens automatically?

            • 3. Re: printing swf error (no alpha channel?)
              kglad Adobe Community Professional & MVP

              myPrintJob.start() is starting the printjob.  that method returns true or false depending whether the start() method was successful or not.