<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Export to JPEG or PDF using esri.layers.ImageParameters ( constructor ) in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-to-jpeg-or-pdf-using-esri-layers/m-p/200798#M18621</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;your &lt;/SPAN&gt;&lt;STRONG&gt;mapImage&lt;/STRONG&gt;&lt;SPAN&gt; variable will hold a URL to where the image was created.&amp;nbsp; you can pop open a new window with that URL or stream it back to the client to be saved as an image file, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It will also have other properties.&amp;nbsp; See here for the list: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/mapimage.htm"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/mapimage.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you do some debugging to figure out if the mapImage variable has these properties?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Jul 2010 22:56:05 GMT</pubDate>
    <dc:creator>AdamPfister</dc:creator>
    <dc:date>2010-07-01T22:56:05Z</dc:date>
    <item>
      <title>Export to JPEG or PDF using esri.layers.ImageParameters ( constructor )</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-to-jpeg-or-pdf-using-esri-layers/m-p/200797#M18620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to utilize the esri.layers.ImageParameters - constructor and the mapservice.exportMapImage but I'm having trouble figuring out where my image is saving and how I can grab it.&amp;nbsp; Can someone take a look at my code and let me know what I'm doing wrong or possibly what I need to add.&amp;nbsp; I think I'm close.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's my code in my JavaScript that is doing the work&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
function createpdf1() {

//Show progress bar page while waiting
 pdfresultframe.document.location.href = "progressbar.html"&amp;nbsp; 

//making the &amp;lt;div...&amp;gt; or framelayer active/visible: functionpdf3
 activateFunction('pdf3') 

//populate figsize value in pdform in map.asp file
 pagesize = document.pdfform.figsize.value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

//populate orientation value in pdform in map.asp file
 orientation = document.pdfform.orientation.value
 
//populate resolution value in pdform in map.asp file
 resolution = document.pdfform.resolution.value 

//populate printoption value in pdform in map.asp file 
 printoption = document.pdfform.printoption.value 

//populate layoutstyle value in pdform in map.asp file
 layoutstyle = document.pdfform.layoutstyle.value 

//Class hierarchy = esri.layers.ImageParameters - constructor
 //Creates a new ImageParameters object. The constructor takes no parameters
 //http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm
figuresettings = new esri.layers.ImageParameters() 

//Set image formate property could be png | png8 | png24 | jpg | pdf | bmp | gif | svg 
 figuresettings.format = "jpg" 
//set width property Requested image width in pixels
 figuresettings.width = width * resolution&amp;nbsp; 
 //set height property Requested image width in pixels 
 figuresettings.height = height * resolution&amp;nbsp; 
//set Dots per inch setting for an ArcGISDynamicMapServiceLayers
 figuresettings.dpi = resolution&amp;nbsp;&amp;nbsp;&amp;nbsp; 


if (printoption == "honorscale") {
&amp;nbsp; theOriginalWidth = map.width/96
&amp;nbsp; theOriginalHeight = map.height/96
&amp;nbsp; if ((width/height) &amp;gt; (theOriginalWidth/theOriginalHeight)) {
&amp;nbsp;&amp;nbsp; theFactor = height/theOriginalHeight
&amp;nbsp; }
&amp;nbsp; else {
&amp;nbsp;&amp;nbsp; theFactor = width/theOriginalWidth
&amp;nbsp; }
&amp;nbsp; theOriginalExtent = map.extent
&amp;nbsp; theNewExtent = theOriginalExtent.expand(theFactor)
&amp;nbsp; figuresettings.bbox = theNewExtent
 }


//exportMapImage - IMapImage exportMapImage(IMapDescription mapDesc,IImageDescription imageDesc)
// Use ExportMapImage to retrieve a file (image or vector format) of the map.
//ExportMapImage to generate an image of the map.The input parameter MapDescription&amp;nbsp; 
//contains properties 
 //http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/mapimage.htm

 mapservice.exportMapImage(figuresettings,createpdf2) 
}


//Use IMapImage to access properties of an ExportMapImage&amp;nbsp; result. 

function createpdf2(mapImage) {&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 document.pdfform.mapimagehref.value = mapImage.href&amp;nbsp;&amp;nbsp;&amp;nbsp; //URL to returned image.
 document.pdfform.printscale.value = mapImage.scale&amp;nbsp;&amp;nbsp;&amp;nbsp; ///Scale of requested dynamic map.
 document.pdfform.submit()&amp;nbsp; // Javascript to submit form / submit call

}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my map.asp page I'm populating a form, here is where I will send my values&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;lt;form name="pdfform" method="post" action="createpdf.asp" target="pdfresultframe"&amp;gt;&amp;nbsp;&amp;nbsp; &amp;lt;!--declaring form name and asp action--&amp;gt;
&amp;nbsp; &amp;lt;input type="hidden" name="mapImagehref"&amp;nbsp;&amp;nbsp; value=""&amp;gt;
&amp;nbsp; &amp;lt;input type="hidden" name="printscale"&amp;nbsp;&amp;nbsp; value=""&amp;gt;
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess my question is: is do I actually set the mapimage.href URL and the mapImage.scale info or is this defaulted somehow.&amp;nbsp; I feel like I'm so close but I'm so confused.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;David Ashton&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 22:35:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-to-jpeg-or-pdf-using-esri-layers/m-p/200797#M18620</guid>
      <dc:creator>DavidAshton</dc:creator>
      <dc:date>2010-07-01T22:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Export to JPEG or PDF using esri.layers.ImageParameters ( constructor )</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-to-jpeg-or-pdf-using-esri-layers/m-p/200798#M18621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;your &lt;/SPAN&gt;&lt;STRONG&gt;mapImage&lt;/STRONG&gt;&lt;SPAN&gt; variable will hold a URL to where the image was created.&amp;nbsp; you can pop open a new window with that URL or stream it back to the client to be saved as an image file, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It will also have other properties.&amp;nbsp; See here for the list: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/mapimage.htm"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/mapimage.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you do some debugging to figure out if the mapImage variable has these properties?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 22:56:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-to-jpeg-or-pdf-using-esri-layers/m-p/200798#M18621</guid>
      <dc:creator>AdamPfister</dc:creator>
      <dc:date>2010-07-01T22:56:05Z</dc:date>
    </item>
  </channel>
</rss>

