3 Replies Latest reply on Jul 22, 2008 1:59 AM by doug777

    Two print problems

    doug777 Level 1
      My print page consists of images and text inside various VBox and HBox containers.

      1. Except for the pictures, a gray background prints behind all the text, presumably it's the gray of the stage.

      2. The text prints in the global text color (on paper it is dark green), but I want it to print black.

      To solve 1. I've tried setStyle on every container backgroundColor white and backgroundAlpha 1, but no change.

      To solve 2. I've tried setStyle color black on containers and text and label, but no change.

      How do I get the text to print in black and the background to be no-color?

        • 1. Re: Two print problems
          doug777 Level 1
          Despite the fact that Flex docs FlexPrintJob states: "... it can print information that is not being displayed." - if I momentarily display the page to be printed, the background color no longer prints under the containers except for the right-hand Padding of the parent VBox. It does not appear in the left-hand Padding!!

          So I now have a broad strip of color down the right hand side of the page.

          I have tried setting the global color to black:

          StyleManager.getStyleDeclaration("global").setStyle("color", "0x000000");

          This has no effect.

          Anyone successfully printed a complicated page that is not a DataGrid and got it to print the text in black?

          • 2. Re: Two print problems
            doug777 Level 1
            Solved the print in black problem. You have to set the printAsBitmap parameter to false and then it prints in black.

            So, one problem left. How to get rid of the greenish-gray strip on the right-hand side of the page where the paddingRight space is.

            • 3. Re: Two print problems
              doug777 Level 1
              Finally solved the color problem. The only way I could find to get rid of the background color was to set background color to "0xffffff" in the mx:Application tag.

              The print out is now correct in all respects, but I must say that the documentation on printing in Flex is full of half-truths and sometimes is just plain wrong.

              As I have proved Flex can print perfectly, but you're hard-pressed to find the way.