ArcGIS JavaScript API printing through PDF

PrinterA common question we received at this year’s ESRI User Conference is how to print maps from the ArcGIS JavaScript API. One way to get a printable map is to export to PDF. ESRI’s Rahul Ravikumar recently uploaded a sample to the Code Gallery that captures an ArcGIS JavaScript API map in a PDF, which can then be printed. He calls this sample Map2PDF.

Map2PDF is a RESTful service that prints all types of layers, including cached (or tiled) map layers, dynamic map layers, and client-side graphics. The sample includes a script PrintMap.js, which helps in serializing ‘map state’ and sends it to the web service. This service uses an open source iText PDF rendering engine to create the PDF.

The Map2PDF sample uses Java Servlet technology and can be deployed any Servlet / J2EE container including Apache Tomcat 6, IBM Websphere, Oracle Weblogic etc. Deployment instructions are included with the Code Gallery download.

Download the Map2PDF sample from the Code Gallery

See an example

This entry was posted in Services and tagged , , . Bookmark the permalink.

Leave a Reply


  1. malleshamm says:

    It is a great module, it is working fine for me, but this module not exporting to PDF identified graphic i.e those are added using this any suggestions please

  2. malleshamm says:

    Hi Rahul Ravikumar,
    But still i am not able to export those customized graphics in to PDF. Could you please give some sample code or suggestion on that. Thanks in advance.