0
votes

I wish to print a chart. I do as follow :

var printJob : PrintJob = new PrintJob();

if ( printJob.start() == false )
    return;

var printOptions : PrintJobOptions = new PrintJobOptions( true );

printJob.addPage( lineChart, null, printOptions );
printJob.send();

but as a result i am receiving only 1 page which containing only some part of the chart.

  • How to scale the whole chart on 1 page, and how to print all of the chart pages when it is not scaled ?
2

2 Answers

2
votes

Alive PDF or Pure PDF or FxPDF is one of the best solutions to create cutom printings.

http://alivepdf.bytearray.org/

http://code.google.com/p/purepdf/

1
votes

You only get one page because you add only one page:

printJob.addPage( lineChart, null, printOptions );

Your chart clip must fit on a page, A4 dimension in pixels should fit in width:559 x height:842.

You can check the dimensions of your chart clip, when it is bigger then the A4 you can scale it accordingly (don't forget print margins). To scale a movielclip you can use scaleX or scaleY, but changing the width or height of the container works better for me, because pixel values are easier then calculating the scale.

You can also create a print template clip, so instead of printing the chart clip immediately you place the charts on a new clip, that way you have more control over the page you are printing. It will also be easier to add more pages to the printjob.