Printing in Adobe AIR - Offline PDF creation

Can I create PDFs in Adobe AIR without having to use a round-trip web service to create a PDF file? I looked at the initial Flex reports in GoogleCode, but two-sided submission is required to create the actual PDF.

Given that AIR should be the ultimate desktop for RIA, is there a way to do this? I suspect I'm missing something, but my documentation searches do not show too much and provide a target for AIR. I can’t believe that this is just what they didn’t include.

+6
flex air printing ria
source share
4 answers

There AlivePDF , which is a PDF library for ActionScript that should work, it was made only for the described situation.

+7
source share

Just added the demo version of Adobe Air + Javascript + AlivePDF:

This demonstration does not require flexibility and is rather straightforward.

http://www.drybydesign.com/2010/02/26/adobe-air-alivepdf-without-flex/

+1
source share

One of the other teams I'm working on is working on a Flex-based graphics application, and they were completely surprised that AIR / Flex does not have built-in PDF authoring. They completed their own simple PDF creator based on the PDF specification.

0
source share

Yes, it’s very simple to create a PDF using AlivePDF, here is a sample code, the first method creates a pdf file and the second method saves the pdf file to disk and returns the path, do not hesitate to ask any questions.

public function createFlexPdf() : String { pdf = new PDF(); pdf.setDisplayMode (Display.FULL_WIDTH,Layout.ONE_COLUMN,Mode.FIT_TO_PAGE,0.96); pdf.setViewerPreferences(ToolBar.SHOW,MenuBar.HIDE,WindowUI.SHOW,FitWindow.RESIZED,CenterWindow.CENTERED); pdf.addPage(); var myFontStyle:IFont = new CoreFont ( FontFamily.COURIER ); pdf.setFont(myFontStyle,10); pdf.addText('Kamran Aslam',10,20);//String, X-Coord, Y-Coord return savePDF(); } private function savePDF():String { var fileStream:FileStream = new FileStream(); var file:File = File.createTempDirectory(); file = file.resolvePath("temp.pdf"); fileStream.open(file, FileMode.WRITE); var bytes:ByteArray = pdf.save(Method.LOCAL); fileStream.writeBytes(bytes); fileStream.close(); return file.url; } 
0
source share

All Articles