Client Side PDF Generation Using Flash, Flex and AIRAs far as I know, it is really complicated and challenging task to generate PDF on the server side. We have recently faced this challenge on the client side. Our products -
LiveArt and
Pivot Table have to incorporate the PDF generation functionality. We have conducted several researches and I am glad to announce that it is easy (hurray :)) to generate PDF using Flash, Flex and AIR. It has become possible thanks to
AlivePDF library. This
post helped us to find it.
How powerful client side PDF generation is? Powerful enough to meet our main need at the moment – generate PDF document as the exact copy of graphic and data visualization objects which users get when they use our Flash/Flex products, like
LiveArt and
Pivot Table. AlivePDF library allows inserting JPEG format images into PDF document. The addImage method uses DisplayObject object (its incoming argument) to take a snapshot of it in JPEG format and insert into the PDF document.
AlivePDF library allows us to easily do the following:
- Set layout, margins, get sizes;
- Add and compose pages;
- Use drawing primitives, manage color models;
- Set fonts and text properties;
- Add images in JPEG format;
- etc.
Of course, there is no limit to perfection. Our dream is to be able to convert Flash vector objects into similar vector objects in PDF. It seems that we need a number of steps undertaken to make it real. But we will strive and will succeed!