<p>Is it possible to generate PDF Documents in an Adobe AIR application without resorting to a round trip web service for generating the PDF? I've looked at the initial Flex Reports on GoogleCode but it requires a round trip for generating the actual PDF.</p>

<p>Given that AIR is supposed to be the Desktop end for RIAs is there a way to accomplish this? I suspect I am overlooking something but my searches through the documentation don't reveal too much and given the target for AIR I can't believe that it's just something they didn't include.</p>

[{'answer_id': 53386, 'author': 'Garo Yeriazarian', 'author_id': 2655, 'author_profile': 'https://Stackoverflow.com/users/2655', 'pm_score': 0, 'selected': False, 'text': '<p>One of the other teams where I work is working on a Flex-based drawing application and they were totally surprised that AIR / Flex does not have PDF authoring built-in.  They ended up rolling their own simple PDF creator based on the PDF specification.</p>\n'}, {'answer_id': 53735, 'author': 'Theo', 'author_id': 1109, 'author_profile': 'https://Stackoverflow.com/users/1109', 'pm_score': 4, 'selected': True, 'text': '<p>There\'s <a href="http://code.google.com/p/alivepdf/" rel="nofollow noreferrer">AlivePDF</a>, which is a PDF generation library for ActionScript that should work, it was made just for the situation you describe.</p>\n'}, {'answer_id': 2345295, 'author': 'Ari Ugwu', 'author_id': 282411, 'author_profile': 'https://Stackoverflow.com/users/282411', 'pm_score': 1, 'selected': False, 'text': '<p>Just added a Adobe Air + Javascript + AlivePDF demo: </p>\n\n<p>This demo <em>doesn\'t</em> require flex and is pretty straight forward.</p>\n\n<p><a href="http://www.drybydesign.com/2010/02/26/adobe-air-alivepdf-without-flex/" rel="nofollow noreferrer">http://www.drybydesign.com/2010/02/26/adobe-air-alivepdf-without-flex/</a></p>\n'}, {'answer_id': 8766756, 'author': 'Kamran Aslam', 'author_id': 653011, 'author_profile': 'https://Stackoverflow.com/users/653011', 'pm_score': 0, 'selected': False, 'text': '<p>Yes it is very easy to create PDF using AlivePDF, here is the sample code, first method create a pdf and second method save the pdf on disk and return the path, feel free to ask any question.</p>\n\n<pre><code>public function createFlexPdf() : String\n{\n    pdf = new PDF();\n    pdf.setDisplayMode (Display.FULL_WIDTH,Layout.ONE_COLUMN,Mode.FIT_TO_PAGE,0.96);\n    pdf.setViewerPreferences(ToolBar.SHOW,MenuBar.HIDE,WindowUI.SHOW,FitWindow.RESIZED,CenterWindow.CENTERED);\n    pdf.addPage();\n    var myFontStyle:IFont = new CoreFont ( FontFamily.COURIER );\n    pdf.setFont(myFontStyle,10);\n        pdf.addText(\'Kamran Aslam\',10,20);//String, X-Coord, Y-Coord \n    return savePDF();\n}\nprivate function savePDF():String\n{\n    var fileStream:FileStream = new FileStream();\n    var file:File = File.createTempDirectory();\n    file = file.resolvePath("temp.pdf");\n    fileStream.open(file, FileMode.WRITE);\n    var bytes:ByteArray = pdf.save(Method.LOCAL);\n    fileStream.writeBytes(bytes);\n    fileStream.close();\n    return file.url;\n}\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/53364', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4959/']