[ 
https://issues.apache.org/jira/browse/FLEX-33407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Derek Clifford Foley updated FLEX-33407:
----------------------------------------

    Description: 
When printing a bitmap image from a display object on an application built to 
use a desktop AIR PC app, Adobe AIR Debug Launcher stops working - with no 
errors in the debug console window. 
This happens on Air 3.4 and 3.1

I have tried many resolutions, but found other people have a similar problem, 
none of the online solutions such as waiting for the stage sprites to be 
complete etc, revalidating the display objects or delaying printing of visible 
bitmaps onscreen using a timer help at all.

I have noticed a key difference which may help find the problem, I first built 
a prototype using the following code.

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009";
                                           
xmlns:s="library://ns.adobe.com/flex/spark"
                                           
xmlns:mx="library://ns.adobe.com/flex/mx"
                                           width="1920" height="1080">
        
        <fx:Script>
                <![CDATA[
                        
                        
                        import flash.printing.*; 
                         
                        
                        
                        
                        function printMe():void
                        {
                                trace("printing");
                                
                                
                                test.test2('hi there matey');
                                var pj:PrintJob = new PrintJob();
                                
                                pj.selectPaperSize(PaperSize.LEGAL); 
                                pj.orientation = PrintJobOrientation.LANDSCAPE; 
                                pj.showPageSetupDialog();
                                //pj.pixelsPerInch = 300;
                                trace("dpi="+pj.maxPixelsPerInch);
                                
                                if (derek.height > pj.pageHeight) 
                                { 
                                        derek.height = pj.pageHeight;
                                }
                                if (derek.width > pj.pageWidth) 
                                { 
                                        derek.width = pj.pageWidth;
                                }
                                derek.validateNow();
                                
                                pj.jobName = "Flash test print";
                                
                                var started:Boolean = pj.start2(null, false);
                                if(started)
                                {
                                        pj.addPage(this.derek);
                                        pj.send();
                                };
                                pj = null;
                        
                        }
                        
                         
                        
                ]]>
        </fx:Script>
        
        <fx:Declarations>
                <!-- Place non-visual elements (e.g., services, value objects) 
here -->
        </fx:Declarations>
        <s:Button x="29" y="29" label="Button" click="printMe()"/>
        <s:Image id="derek" x="516" y="337" source="example.jpg"/>
</s:WindowedApplication>


This worked ok, printing to the Microsoft XPS document creator. I then built 
the code into a more complex app that uses "States" and this is where the 
problem began.Seems to happen if the application has multiple "States" using 
mxml - an app with a single state causes no issues.

My more complex app runs fine in every other way, has no errors etc and 
triggers a version of the above function - what is strange and impossible to 
diagnose is because the crash occurs with no warnings on compilation either - 
it happens only at runtime - also tried exporting as a .air file too, same 
happens with the runtime version as well as the debug app. The crash occurs 
after the page properties are selected using the print dialog, no error appears 
and the AIR debug crashes, Flash Builder remains running though, oblivious to 
any issues.

(I also tried outputting a PDF too, just in case the Microsoft printing method 
was faulty) same issue.

start2 command is being used. Also happens if the app shows the print 
properties dialog too. I also tried the standard printjob methods and had the 
same problems.

Crash dump file is available here... 
https://www.dropbox.com/c/shmodel?nsid=167814409&sjid=0&state=2&signature=7e6bc1b&path=/adl.exe.68800.zip&id=shmodel

  was:
When printing a bitmap image from a display object on an application built to 
use a desktop AIR PC app, Adobe AIR Debug Launcher stops working - with no 
errors in the debug console window. This happens on Air 3.4 and 3.1

Seems to happen if the application has multiple "States" using mxml - an app 
with a single state causes no issues.

start2 command is being used. Also happens if the app shows the print 
properties dialog too.

    
> Printjob crashes AIR Debug Launcher
> -----------------------------------
>
>                 Key: FLEX-33407
>                 URL: https://issues.apache.org/jira/browse/FLEX-33407
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Print Management
>    Affects Versions: Apache Flex 4.9.0
>         Environment: Windows 7 x64, Flash Builder 4.6, Intel Core i7-2600 @ 
> 3.4Ghz, 16gigs Ram
>            Reporter: Derek Clifford Foley
>              Labels: air, print, printJob, printing
>             Fix For: Apache Flex Next
>
>
> When printing a bitmap image from a display object on an application built to 
> use a desktop AIR PC app, Adobe AIR Debug Launcher stops working - with no 
> errors in the debug console window. 
> This happens on Air 3.4 and 3.1
> I have tried many resolutions, but found other people have a similar problem, 
> none of the online solutions such as waiting for the stage sprites to be 
> complete etc, revalidating the display objects or delaying printing of 
> visible bitmaps onscreen using a timer help at all.
> I have noticed a key difference which may help find the problem, I first 
> built a prototype using the following code.
> <?xml version="1.0" encoding="utf-8"?>
> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009";
>                                          
> xmlns:s="library://ns.adobe.com/flex/spark"
>                                          
> xmlns:mx="library://ns.adobe.com/flex/mx"
>                                          width="1920" height="1080">
>       
>       <fx:Script>
>               <![CDATA[
>                       
>                       
>                       import flash.printing.*; 
>                        
>                       
>                       
>                       
>                       function printMe():void
>                       {
>                               trace("printing");
>                               
>                               
>                               test.test2('hi there matey');
>                               var pj:PrintJob = new PrintJob();
>                               
>                               pj.selectPaperSize(PaperSize.LEGAL); 
>                               pj.orientation = PrintJobOrientation.LANDSCAPE; 
>                               pj.showPageSetupDialog();
>                               //pj.pixelsPerInch = 300;
>                               trace("dpi="+pj.maxPixelsPerInch);
>                               
>                               if (derek.height > pj.pageHeight) 
>                               { 
>                                       derek.height = pj.pageHeight;
>                               }
>                               if (derek.width > pj.pageWidth) 
>                               { 
>                                       derek.width = pj.pageWidth;
>                               }
>                               derek.validateNow();
>                               
>                               pj.jobName = "Flash test print";
>                               
>                               var started:Boolean = pj.start2(null, false);
>                               if(started)
>                               {
>                                       pj.addPage(this.derek);
>                                       pj.send();
>                               };
>                               pj = null;
>                       
>                       }
>                       
>                        
>                       
>               ]]>
>       </fx:Script>
>       
>       <fx:Declarations>
>               <!-- Place non-visual elements (e.g., services, value objects) 
> here -->
>       </fx:Declarations>
>       <s:Button x="29" y="29" label="Button" click="printMe()"/>
>       <s:Image id="derek" x="516" y="337" source="example.jpg"/>
> </s:WindowedApplication>
> This worked ok, printing to the Microsoft XPS document creator. I then built 
> the code into a more complex app that uses "States" and this is where the 
> problem began.Seems to happen if the application has multiple "States" using 
> mxml - an app with a single state causes no issues.
> My more complex app runs fine in every other way, has no errors etc and 
> triggers a version of the above function - what is strange and impossible to 
> diagnose is because the crash occurs with no warnings on compilation either - 
> it happens only at runtime - also tried exporting as a .air file too, same 
> happens with the runtime version as well as the debug app. The crash occurs 
> after the page properties are selected using the print dialog, no error 
> appears and the AIR debug crashes, Flash Builder remains running though, 
> oblivious to any issues.
> (I also tried outputting a PDF too, just in case the Microsoft printing 
> method was faulty) same issue.
> start2 command is being used. Also happens if the app shows the print 
> properties dialog too. I also tried the standard printjob methods and had the 
> same problems.
> Crash dump file is available here... 
> https://www.dropbox.com/c/shmodel?nsid=167814409&sjid=0&state=2&signature=7e6bc1b&path=/adl.exe.68800.zip&id=shmodel

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to