Create PDF or JPG File in Adobe Air Using ActionScript 3 and AlivePDF Library

We can use purePDF or AlivePDF ActionScript 3 libraries for creating PDF from Adobe Air.

This example code showing how to saved and stored a .JPG file on the device. this way you may save .PDF file also. I will show full PDF example here.

f = File.documentsDirectory.resolvePath(fil_name+".jpg");      
stream = new FileStream();
stream.open(f, FileMode.WRITE);                                         
i = new JPGEncoder(80);     
bytes = new ByteArray();
bytes = i.encode(snapShot.bitmapData);
stream.writeBytes(bytes, 0, bytes.bytesAvailable);
stream.close();

Comments

comments