You want to print html based content in Flex without FelxPrintJob but using browsers capabilities.
You have to create JavaScript printing function and invoke it by ExternalInterface
If you want to print html based content in Flex using browsers capabilities you have to modiffy your index.template.html (located in html-template directory). Find </head> tag and paste above following code:
<script language="JavaScript">
function printPage(htmlPage)
{
var w = window.open("about:blank");
w.document.write(htmlPage);
w.print();
w.close();
}
</script>
This JavaScript function opens new tab/window, creates html page and shows printing dialog of browser. After finished printing the tab/window is being closed.
To call this from your ActionScript code you may use following function:
import mx.controls.Alert;
import flash.external.ExternalInterface;
public static function PrintHtmlPage(pHtmlPage:String):void
{
if (ExternalInterface.available)
{
try
{
ExternalInterface.call("printPage",pHtmlPage);
}
catch (error:SecurityError) { Alert.show("Security Error"); }
catch (error:Error) { Alert.show("Error");}
}
else { Alert.show("ExternalInterface not avalible");}
}
Where pHtmlPage is HTML based String i.e "<html><h1>Helo World</h1></html>"