4 Replies Latest reply on Dec 18, 2007 3:32 PM by Newsgroup_User

    Printing Transparent PNGs with PrintJob

    Level 7
      Hello,

      I'm using Flash 8 for Windows. I'm trying to print a frame which contains a
      number of transparent PNG graphics. However when I print it, these graphics
      appear with a white bounding box around them. Do you know how I can get them
      to print without the bounding box?

      This is the script I'm using:

      on (release){
      var pjOutput:PrintJob = new PrintJob();

      if(pjOutput.start()){
      pjOutput.addPage(_root,true);
      pjOutput.send();
      }

      delete pjOutput;
      }

      Thanks.

      CPG


        • 1. Re: Printing Transparent PNGs with PrintJob
          Level 7
          Cesar,

          > However when I print it [PNGs], these graphics appear with
          > a white bounding box around them. Do you know how I can
          > get them to print without the bounding box?

          You're using only two of the allowable parameters in the addPage()
          method. If you add the third parameter (options), you can specify
          printAsBitmap, which should allow the transparent areas of the PNGs to print
          as expected.

          Check out those parameters again, because the second one is supposed to
          be an object with with four properties for specifying dimensions (you're
          providing a Boolean, true, in that slot).


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: Printing Transparent PNGs with PrintJob
            Level 7
            I added the other parameters to the addPage line but the problem remains. I
            even tried using different values true, false, null. In every case the
            problem remains.

            Here's how the line looks now:

            pjOutput.addPage(_root,{xMin:0,xMax:700,yMin:0,yMax:400},true,1);

            CPG

            "David Stiller" <stiller@quip-remove-.net> escribió en el mensaje
            news:fk92hi$fi5$1@forums.macromedia.com...
            > Cesar,
            >
            >> However when I print it [PNGs], these graphics appear with
            >> a white bounding box around them. Do you know how I can
            >> get them to print without the bounding box?
            >
            > You're using only two of the allowable parameters in the addPage()
            > method. If you add the third parameter (options), you can specify
            > printAsBitmap, which should allow the transparent areas of the PNGs to
            > print as expected.
            >
            > Check out those parameters again, because the second one is supposed to
            > be an object with with four properties for specifying dimensions (you're
            > providing a Boolean, true, in that slot).
            >
            >
            > David Stiller
            > Adobe Community Expert
            > Dev blog, http://www.quip.net/blog/
            > "Luck is the residue of good design."
            >


            • 3. Re: Printing Transparent PNGs with PrintJob
              Level 7
              Cesar,

              > I added the other parameters to the addPage line but the
              > problem remains. I even tried using different values true,
              > false, null. In every case the problem remains.

              It's important -- in fact, imperative -- that your parameters are
              provided in the format/datatype Flash expects. Let's step through it:

              > pjOutput.addPage(_root,{xMin:0,xMax:700,yMin:0,yMax:400},true,1);

              The first parameter, _root, is fine. That means it will it will print
              the main timeline.

              The second parameter is also fine. This parameter needs to be an object
              (which it is), and its properties need to be xMin, xMax, yMin, and yMax. So
              far, so good.

              The third parameter is not a Boolean, so true or false simply won't do.
              This parameter, like the second one, also needs to be an object. My hunch
              is that it's set up this way in order to allow for numerous options, but as
              it turns out, printAsBitmap is the only option available. This parameter
              needs to be formatted like this: {printAsBitmap: true}.

              Finally, the four parameter lets you specify a frame, and 1 is fine.

              I just tested this, and it prints transparency for me beautifully. :)


              David Stiller
              Co-author, Foundation Flash CS3 for Designers
              http://tinyurl.com/2k29mj
              "Luck is the residue of good design."


              • 4. Re: Printing Transparent PNGs with PrintJob
                Level 7
                It works now.

                Huge thanks, David.

                CPG


                "David Stiller" <stiller@quip-remove-.net> escribió en el mensaje
                news:fk9bt6$pn0$1@forums.macromedia.com...
                > Cesar,
                >
                >> I added the other parameters to the addPage line but the
                >> problem remains. I even tried using different values true,
                >> false, null. In every case the problem remains.
                >
                > It's important -- in fact, imperative -- that your parameters are
                > provided in the format/datatype Flash expects. Let's step through it:
                >
                >> pjOutput.addPage(_root,{xMin:0,xMax:700,yMin:0,yMax:400},true,1);
                >
                > The first parameter, _root, is fine. That means it will it will print
                > the main timeline.
                >
                > The second parameter is also fine. This parameter needs to be an
                > object (which it is), and its properties need to be xMin, xMax, yMin, and
                > yMax. So far, so good.
                >
                > The third parameter is not a Boolean, so true or false simply won't do.
                > This parameter, like the second one, also needs to be an object. My hunch
                > is that it's set up this way in order to allow for numerous options, but
                > as it turns out, printAsBitmap is the only option available. This
                > parameter needs to be formatted like this: {printAsBitmap: true}.
                >
                > Finally, the four parameter lets you specify a frame, and 1 is fine.
                >
                > I just tested this, and it prints transparency for me beautifully. :)
                >
                >
                > David Stiller
                > Co-author, Foundation Flash CS3 for Designers
                > http://tinyurl.com/2k29mj
                > "Luck is the residue of good design."
                >