I ran a quick test and it is possible using alivePDF, just add your legend as a component to the map and you can use the addimage property in alivePDf to add the legend as an image to the report.
oops didn't see this until just now. sorry no, its the clients. but if you have specific questions i can probably whip up generic cf code.
our suite of apps parses the layers in each map service the apps will use via rest calls (an admin app that sets which users/groups can use which map services/tools, etc). that includes the legends. that's all stored in a sql server table & this reporting tool simply pulls that data out of the table & adds it to the PDF.
the map template is from arcMap. i get a PDF of that blank template & measure out the available space for the legend, etc. using a PDF tool (foxit for example)--mainly because the designers either don't know or won't say the space available for each piece of the template. those become constants. the legend,etc. tables are built in server memory & measured against the available space.if they fit, they go in, if not they get added to a supplemental page (next iteration will measure rows & fit as many as possible instead of this binary approach).
if you can read coldfusion, i'll try to get a generic example together.
attached is the code I used in my application. Any questions let me know
public function generatePDF2():void { var myCoreFont1:IFont = new CoreFont ( FontFamily.ARIAL ); myPDF = new PDF(Orientation.PORTRAIT, Unit.MM, Size.TABLOID); myPDF.setDisplayMode( Display.FULL_PAGE, Layout.SINGLE_PAGE ); myPDF.addPage(); myPDF.setFont(myCoreFont1, 12); myPDF.addText('List of Development Services Projects - Status', 11, 10); myPDF.setFont(myCoreFont1, 8); myPDF.addText('Printed:' + dateFormatter.format(now.toLocaleDateString()), 180, 10); var gridColumnOwner1:GridColumn = new GridColumn("Project Name", "Name", 90, Align.LEFT, Align.LEFT); var gridColumnOwner2:GridColumn = new GridColumn("Condition", "Color", 18, Align.LEFT, Align.LEFT); var gridColumnAddress:GridColumn = new GridColumn("Status", "Status", 20, Align.LEFT, Align.LEFT); var gridColumnMailCity:GridColumn = new GridColumn("Next Step", "Cur_Status", 20, Align.LEFT, Align.LEFT); var gridColumnMailStat:GridColumn = new GridColumn("Department", "DS_Department", 35, Align.LEFT, Align.LEFT); var gridColumnManager:GridColumn = new GridColumn("Project Manager", "Manager", 35, Align.LEFT, Align.LEFT); var gridColumnCost:GridColumn = new GridColumn("Project Assistant", "Assistant", 35, Align.LEFT, Align.LEFT); myPDF.setFont(myCoreFont1, 8); myPDF.textStyle ( new RGBColor ( 0x000000 ), 1 ); //resultsGrid is the name of the datagrid var grid:Grid = new Grid (resultsGrid.dataProvider.toArray(), 0, 0, new RGBColor (0xC0C0C0), new RGBColor (0xCCCCCC), true , new RGBColor(0x000000), 1, Joint.ROUND); var columns:Array = new Array (gridColumnOwner1,gridColumnOwner2, gridColumnAddress, gridColumnMailCity, gridColumnMailStat, gridColumnManager, gridColumnCost); grid.columns = columns; myPDF.addGrid(grid, 1, 6); //export to pdf web service myPDF.save(Method.REMOTE, "name of server",Download.INLINE,"myPDF.pdf"); }
here is some code for just printing a tablepublic function generatePDF2():void { var myCoreFont1:IFont = new CoreFont ( FontFamily.ARIAL ); myPDF = new PDF(Orientation.PORTRAIT, Unit.MM, Size.TABLOID); myPDF.setDisplayMode( Display.FULL_PAGE, Layout.SINGLE_PAGE ); myPDF.addPage(); myPDF.setFont(myCoreFont1, 12); myPDF.addText('List of Development Services Projects - Status', 11, 10); myPDF.setFont(myCoreFont1, 8); myPDF.addText('Printed:' + dateFormatter.format(now.toLocaleDateString()), 180, 10); var gridColumnOwner1:GridColumn = new GridColumn("Project Name", "Name", 90, Align.LEFT, Align.LEFT); var gridColumnOwner2:GridColumn = new GridColumn("Condition", "Color", 18, Align.LEFT, Align.LEFT); var gridColumnAddress:GridColumn = new GridColumn("Status", "Status", 20, Align.LEFT, Align.LEFT); var gridColumnMailCity:GridColumn = new GridColumn("Next Step", "Cur_Status", 20, Align.LEFT, Align.LEFT); var gridColumnMailStat:GridColumn = new GridColumn("Department", "DS_Department", 35, Align.LEFT, Align.LEFT); var gridColumnManager:GridColumn = new GridColumn("Project Manager", "Manager", 35, Align.LEFT, Align.LEFT); var gridColumnCost:GridColumn = new GridColumn("Project Assistant", "Assistant", 35, Align.LEFT, Align.LEFT); myPDF.setFont(myCoreFont1, 8); myPDF.textStyle ( new RGBColor ( 0x000000 ), 1 ); //resultsGrid is the name of the datagrid var grid:Grid = new Grid (resultsGrid.dataProvider.toArray(), 0, 0, new RGBColor (0xC0C0C0), new RGBColor (0xCCCCCC), true , new RGBColor(0x000000), 1, Joint.ROUND); var columns:Array = new Array (gridColumnOwner1,gridColumnOwner2, gridColumnAddress, gridColumnMailCity, gridColumnMailStat, gridColumnManager, gridColumnCost); grid.columns = columns; myPDF.addGrid(grid, 1, 6); //export to pdf web service myPDF.save(Method.REMOTE, "name of server",Download.INLINE,"myPDF.pdf"); }