Select to view content in your preferred language

Graphics Not Being Included in PrintTask - NOT USING esri/dijit/Print

804
2
09-24-2013 10:45 AM
RafaelFerraro
Deactivated User
I have a Javascript application that is attempting to allow users to create exports (png,jpeg,pdf...etc) of the web maps they create inside the application.  I am NOT using the esri.dijit.Print, instead using the esri/tasks/PrintTask directly. 

For whatever reason, I can't seem to include any graphics (in either a GraphicsLayer or FeatureLayer instance) in the export.  The Basemap and visible ArcGISDynamicMapServiceLayers are included exactly as expected.  As far as I can tell, there is no flag in either the PrintParameters or PrintTemplate classes that would block graphics.

When I look at the outgoing http request for PrintTask.execute(), the graphics are DEFINITELY not included.  Is there something I am missing, any way to force graphics to be included on PrintTask.execute()?
0 Kudos
2 Replies
VinayBansal
Frequent Contributor
Print task exports graphics that are displayed on map in Print.
Please share your code so that we can have a look. Also, make sure you have added the print task url in the proxy.config.
0 Kudos
RafaelFerraro
Deactivated User
Thanks for your response.  Here is the crux of the code I am using for my print task - no graphics layers ever make into exported map.  As for proxy.config (ASP.NET backend), I have the mustMatch set to false, so I dont believe I need to add print task url.

 var printParams = new esri.tasks.PrintParameters();
                printParams.map = App.map;

                var template = new esri.tasks.PrintTemplate();
                template.format = "pdf";
                template.layout = $('#selLayout').val();
                template.preserveScale = true;

                template.layoutOptions = {
                    titleText: $('#inputMapTitle').val(),
                    authorText: $('#inputMapAuthor').val(),
                    scalebarUnit: $('#selScalebarUnit').val()
                };

                printParams.template = template;
                var deferred = Mod.controller.printTask.execute(printParams);
0 Kudos