I've been using the Flex Map Printing Utility by Mark Hoyland (http://arcscripts.esri.com/details.asp?dbid=16778) for the past year, and it works great. I especially like the fact that it will clip the map to a different extent based on the page orientation. I would like to add a PDF button to the PrintPreview that allows the user to save the same layout into a PDF. I have gathered from other posts that he and others are using the AlivePDF library to accomplish this. I now have the AlivePDF library and can generate a PDF, but I'm having trouble using the suggestion from a thread from Mark Hoyland http://forums.esri.com/Thread.asp?c=158&f=2421&t=296597(see the March 17, 2010 post). The post from Mark says he does the following, but not where:var myBitmapData:BitmapData = Bitmap(mapImage.content).bitmapData;
myPDF.addImage(new Bitmap(myBitmapData),rectangle.x,rectangle.y,image.width,image.height, ImageFormat.JPG, 75);
It just doesn't seem like I have all of the pieces in the same place at one time in order to send the images or objects to be made into a PDF. So far, I've made the same mistakes as my predecessors in the forums (like getting low quality, small versions of the layout or map in a PDF), but still can't figure out the solution.I can't figure out how I'm supposed to link up PrintMapUtil.as with the PDF code. Am I supposed to:- Add something to PrintMapUtil.as to get the layout as BitmapData and then generate the PDF there, OR
- Make new MXML layouts for PDFs and call the trimmedMap function from those, OR
- Add the PDF generating functions to the PrintPreview.mxml.
Can someone point me in the right direction?