I'm having sandbox violations when I attempt to export if I have WMS in my operational layers that have skipgetcapabilities="true"does this export to pdf support WMS?
This is a print sample that Mark H put together. I find it to be a very nice utility for trimming the map to get the print size correct. There are a few different pieces to get this to work but I would recommend downloading it and looking at the code to see how he trims the map. I use some of this code on my site and it has been very helpful for sizing the map correctly. Technically you don't need all of the pieces and you can just call his PrintMapUtil.as to return your map as a bitmap. http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=codeGalleryDetails&scriptID=16778
Hey Nadeem,Did you ever get this to work? I am having the same problem with the widget, it is not doing anything, when i click on Generate PDF. Thanks.
Philipp,I have downloaded the source code for PDF Widget and incorporated the AlivePDF.swc to libs. The widget is implemented error free, but does not proceed further after I click on the "Generate PDF" button. Could you post the latest widget source code?nshaukat
Oh ya...you need to include the AlivePDF.swc library in your build path. I've attached the latest AlivePDF.swc here (0.1.5 RC). Don't forget to also add PDFWidget.mxml to the modules for building...
else //create a landscape map { //create landscape letter-size pdf and set margins landPDF=new PDF(Orientation.LANDSCAPE,Unit.MM,Size.LETTER); landPDF.setDisplayMode(Display.FULL_PAGE,Layout.SINGLE_PAGE); landPDF.setMargins(2,2,2,2); landPDF.addPage(); //add PDF document metadata--most people never notice but give credit where due //and create a "well-formed" pdf document landPDF.setTitle(txtTitle.text); landPDF.setSubject(pdfSubject); landPDF.setAuthor(pdfAuthor); landPDF.setKeywords(pdfKeywords); landPDF.setCreator(pdfCreator); //draw neat line //landPDF.drawRect(new Rectangle(2,2,275,212)); //draw title block rectangle landPDF.drawRect(new Rectangle(3,3,273,32)); //add logo image landPDF.addImageStream(new myLogoJPG() as ByteArray,"DeviceRGB",null,3,5,40,0,0,1,Blend.NORMAL,null); //add title text entered in widget input landPDF.setFont(timesboldFont,22); landPDF.addText(txtTitle.text,50,10); //add subtitle text entered in widget input landPDF.setFont(timesFont,16); landPDF.addText(txtSubtitle.text,50,17); //add some disclaimer text var landDisclaimerLine1:String="DISCLAIMER: This map is for informational purposes and has not been prepared for, nor is it suitable for legal, surveying, or engineering purposes. Users of this information "; var landDisclaimerLine2:String="should review or consult the primary data and information sources to ascertain the usability of the information. The xyz makes no warranty or ascertain "; var landDisclaimerLine3:String="the usability of the information. The xyz makes no warranty or guarantee as to the content, accuracy, timeliness, or completeness of any of the data"; var landDisclaimerLine4:String="provided, and assumes no legal responsibility for the information contained hereon."; landPDF.setFont(arialFont,8); landPDF.addText(landDisclaimerLine1,50,21); landPDF.addText(landDisclaimerLine2,50,24); landPDF.addText(landDisclaimerLine3,50,27); landPDF.addText(landDisclaimerLine4,50,30); //add copyright text landPDF.setFont(arialFont,9); landPDF.addText(copyright,50,33); //add print timestamp landPDF.setFont(arialFont,8); var nowLand:String = getCurrentDateTime(); landPDF.addText("Printed: " + nowLand,5,7); //add the map var rsLand:Resize=new Resize("FitToPage","left"); landPDF.addImage(map,rsLand,2,35,0,0,0,1,false,ImageFormat.JPG,100,Blend.NORMAL,null); //save the pdf const fileReferenceLand:FileReference = new FileReference(); fileReferenceLand.save(landPDF.save(Method.LOCAL,"",Download.INLINE,"landPDF.pdf"),"map.pdf"); } } ]]> </fx:Script> <viewer:WidgetTemplate id="wTemplate" height="190" width="300"> <mx:ViewStack id="viewStack" width="100%" height="100%" creationPolicy="all"> <mx:VBox width="100%" height="100%" verticalGap="10" paddingTop="10"> <mx:Form id="frmPrint" verticalScrollPolicy="off" paddingBottom="0" width="100%" height="100%"> <mx:FormItem label="{titleLabel}" styleName="WidgetText" width="100%"> <mx:TextInput id="txtTitle" text="{title}" /> </mx:FormItem> <mx:FormItem label="{subtitleLabel}" styleName="WidgetText" width="100%"> <mx:TextInput id="txtSubtitle" text="{subtitle}" /> </mx:FormItem> <!--mx:FormItem label="Label"--> <mx:ToggleButtonBar id="pgOrient" selectedIndex="-1" itemClick="setPageOrientation(event);"> <mx:dataProvider> <fx:Array> <!--fx:String>Portrait</fx:String--> <!--fx:String>Landscape</fx:String--> </fx:Array> </mx:dataProvider> </mx:ToggleButtonBar> <!--/mx:FormItem--> <mx:HBox horizontalAlign="center" width="100%"> <mx:Button label="{submitLabel}" click="makePDF(event)" /> </mx:HBox> <mx:Spacer width="100%" height="1" /> <s:Label text=" Be patient while PDF is building..." fontStyle="normal" fontSize="12" /> </mx:Form> </mx:VBox> </mx:ViewStack> </viewer:WidgetTemplate> </viewer:BaseWidget>
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.