Reputation: 848
I want to know if anyone has successfully printed something from Flex.
By successful I am talking about some sort of report or document or whatever.
I know its fairly simple to print a component(which is a bit cheap) from Flex by using the printJob() class and passing a component. But I want to pass an object like a list or XML to printJob().
Upvotes: 5
Views: 728
Reputation: 10648
purepdf is best among all for printing in flex it converts the flex data to pdf for printing
Upvotes: 0
Reputation: 1174
AlivePDF seems to be gaining steam in the community, give it a look.
Upvotes: 3
Reputation: 23632
http://livedocs.adobe.com/flex/3/langref/mx/printing/FlexPrintJob.html
The best way is to handle it through Backend. But again you can use ActionScript to print your object contents. Have you heard of BitmapData Class.
http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/display/BitmapData.html
With this you can read pixel by pixel and send to printer to print the Object.
Upvotes: 0
Reputation: 39408
How do you want your object to look in the printout? And how do you expect Flex to know that? How can you expect Flex to print out an object with no visual representation?
As best I understand most people will give up trying to do printing in Flex and pass such objects to the backend and use something (such as iText or ColdFusion ) to generate a PDF.
Of course, whether doing this in the backend, or with Flex, you'll still have to write the formatting code.
I'm sure you can extend the PrintJob class to accept an object and format it for printing before actually printing.
Upvotes: 1