Flash player graph not showing on print

131 Views Asked by At

I am trying to print a graph from a page, the graph is made using Fusion Charts that use Flash Player. After the chart is rendered on the page it results:

<div>
<embed type="application/x-shockwave-flash" src="../components/fusion_bar/swf/FCF_Bar2D.swf" width="800" height="400" id="productSales" name="productSales" quality="high" allowscriptaccess="always" wmode="transparent" flashvars="chartWidth=800&amp;chartHeight=400&amp;debugMode=0&amp;DOMId=productSales&amp;registerWithJS=0&amp;scaleMode=noScale&amp;lang=EN&amp;dataXML=<graph caption='' subCaption='' yAxisMinValue='0' yAxisMaxValue='5' yaxisname='Number of documents' xaxisname='Directions' showZeroPlaneValue='1' showAlternateVGridColor='1' alternateVGridAlpha='10' alternateVGridColor='AFD8F8' numDivLines='4' decimalPrecision='0' canvasBorderThickness='1' canvasBorderColor='114B78' baseFontColor='114B78' hoverCapBorderColor='114B78' hoverCapBgColor='E7EFF6' formatNumberScale='1' thousandSeparator='.' decimalSeparator=','><set name='Test 1' value='3' color='AFD8F8' /><set name='Test 2' value='0' color='F6BD0F' /></graph>"> 
</div>

I tried printing the page using window.print(), then converting the content in a image using html2canvas but the chart is not getting displayed on printing. It's there any other option of printing some flash player content?

1

There are 1 best solutions below

0
On

To enable communication between charts and JavaScript (like updating data, retrieving data, printing, exporting, event handling etc.) in your local machine, you need to setup Flash Player Global Security settings.

Flash Player's Global Security implementation blocks JavaScript to interact with charts (Flash charts) when you are running the the web page or application with charts from local file system. To configure Flash Player Global Security Settings (to enable links and chart APIs) and enable JavaScript calls from charts, you will need to add the folder containing the chart SWF files to Flash Player's Trusted Zone.

Please refer to How to Setup Flash Player Global Security Settings page for a detailed step-by-step guide : https://docs.fusioncharts.com/charts/Tools/FlashPlayerSecuritySetup/HowToSetup.html

For managed printing in Chrome Browser, could you please try using the following code -

FusionCharts.printManager.enabled(true);

Once enabled, all the charts present in a page are prepared to print correctly. Once the charts are ready, which can be tracked by listening to an event raised by the Print Manager, you can use browser's File > Print menu, JavaScript's native window.print() function or Print Manager's advanced function - managedPrint(). In any of these actions, the charts would come-up properly in the print media.

Hope this helps