0
votes

When printing (I think at the point I call FlexPrintJob.addObject()) I get the following:

Warning: Filter will not render. The DisplayObject's filtered dimensions (3324, 1740) are too large to be drawn.

I don't know what it thinks is 3324, 1740. The mx:Box object I pass to it is about 600x100.

I'm wondering if this problem is related to another problem I'm having. What gets printed has an extra border on the bottom and the right of what I want printed. I'm hoping that understanding this message will correct my problem.

I'm using the Flex 3.5 SDK

Here's a stripped down version of the code that still allows for this problem:

<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"     
            title="FPL Flight Strip" 
        showCloseButton="true" 
        borderAlpha="1"
        borderColor="{BrandGlobals.COLOUR_DARK}" 
        borderThicknessBottom="1" 
    borderThicknessLeft="1" 
    borderThicknessRight="1" 
    borderThicknessTop="0" 
    dropShadowEnabled="true"  
    fontSize="{AppGlobals.fntSize}" 
    backgroundAlpha="1.0" 
    alpha="1.0"
    creationComplete="init()"
    close="PopUpManager.removePopUp(this);">
<mx:Script>
    <![CDATA[
        import mx.managers.PopUpManager;
        import mx.printing.FlexPrintJobScaleType;
        import mx.printing.FlexPrintJob;


        private function init():void
        {
            this.setStyle('fontFamily', 'Arial');
        }

        private function printData():void
        {
            var dbPrintJob: FlexPrintJob = new FlexPrintJob();
            if (dbPrintJob.start()) 
            {
                try 
                {
                    dbPrintJob.addObject(boxPrint, FlexPrintJobScaleType.NONE);
                }
                catch (e:Error) 
                {
                    //trace(e);
                }
                dbPrintJob.send();
            }
        }

    ]]></mx:Script>
     <mx:VBox width="600" height="100" horizontalAlign="center" verticalAlign="middle" backgroundColor="#FFFFFF" verticalGap="1" paddingLeft="2" paddingRight="2" paddingTop="2" paddingBottom="2">
        <mx:Box id="boxPrint" width="100%" height="100%" backgroundColor="#FFFFFF">
            <mx:Box id="box" width="100%" height="100%"/>
        </mx:Box>
    </mx:VBox>
    <mx:ControlBar width="100%" barColor="#E8E8E8" paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0">
        <mx:VBox width="100%" height="100%" horizontalAlign="left" backgroundColor="#E8E8E8" paddingTop="5" paddingBottom="5" paddingRight="20" paddingLeft="20">
            <mx:HBox width="100%" height="100%">
                <mx:Button label="Print Strip" fontFamily="Arial" click="printData()" width="100" height="25" />
            </mx:HBox>
        </mx:VBox>
    </mx:ControlBar>
</mx:TitleWindow>
2
I've never seen it before. I would suggest posting a test case that reproduces the error.drkstr101

2 Answers

1
votes

I was not able to reproduce the filter error in Flex 3.6. Are you not able to upgrade? To my knowledge, there shouldn be very few issues with backwards compatibility, unless you are heavily overriding mx_internal.

I did however get the problem with the borders. This has to do with the way you are adding your objects. It's best to wrap the thing you want to print in a container, then add the container to the print job. This let's you control things like margins and spacing.

private function printData():void
{
    var dbPrintJob:FlexPrintJob = new FlexPrintJob();

    if(dbPrintJob.start())
    {
        try
        {
            dbPrintJob.addObject(this.canvas, FlexPrintJobScaleType.NONE);
        }
        catch(e:Error)
        {
            //trace(e);
        }
        dbPrintJob.send();
    }
}

<mx:Canvas id="canvas" width="100%" height="100%">
    <mx:Box id="boxPrint" top="10" left="10" bottom="10" right="10" backgroundColor="#FFFFFF">
        <mx:Box id="box" width="100%" height="100%" />
    </mx:Box>
</mx:Canvas>

Use the canvas to paint your background and space the children into the desired print layout.

I would also suggest giving this a quick read:

Setting size, scale, and orientation

0
votes

You can try using a simple font such as "Arial", and try if the error still appears, to rule out problems than font. And avoid using any component if you're having this problem to see if that eliminates the problem.