<?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: Create Pdf using attribute data in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/create-pdf-using-attribute-data/m-p/789049#M3916</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have already done this by sending data to server side but now In final report I want to make consolidated report that will contain Map also in single pdf file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Jun 2015 05:22:31 GMT</pubDate>
    <dc:creator>shafitrumboo</dc:creator>
    <dc:date>2015-06-11T05:22:31Z</dc:date>
    <item>
      <title>Create Pdf using attribute data</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/create-pdf-using-attribute-data/m-p/789046#M3913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have all attribute data at my client side how I can create pdf.&lt;/P&gt;&lt;P&gt;I know I can pass this data to .ashx or&amp;nbsp; serverside and create a pdf at backend. But is this idle way&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 12:42:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/create-pdf-using-attribute-data/m-p/789046#M3913</guid>
      <dc:creator>shafitrumboo</dc:creator>
      <dc:date>2015-05-21T12:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: Create Pdf using attribute data</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/create-pdf-using-attribute-data/m-p/789047#M3914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3101"&gt;Robert Scheitlin, GISP&lt;/A&gt; . Please provide your valueable inputs. If i wrap this application in MVC will it work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 19:07:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/create-pdf-using-attribute-data/m-p/789047#M3914</guid>
      <dc:creator>shafitrumboo</dc:creator>
      <dc:date>2015-05-21T19:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create Pdf using attribute data</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/create-pdf-using-attribute-data/m-p/789048#M3915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shafi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I have not attempted to create PDFs in JS, so I don't have any advice for you on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 19:09:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/create-pdf-using-attribute-data/m-p/789048#M3915</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-05-21T19:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create Pdf using attribute data</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/create-pdf-using-attribute-data/m-p/789049#M3916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have already done this by sending data to server side but now In final report I want to make consolidated report that will contain Map also in single pdf file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 05:22:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/create-pdf-using-attribute-data/m-p/789049#M3916</guid>
      <dc:creator>shafitrumboo</dc:creator>
      <dc:date>2015-06-11T05:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create Pdf using attribute data</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/create-pdf-using-attribute-data/m-p/789050#M3917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shafi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; OK. here is some code to get the map image and add it to the DOM. How you get this to the server or do this differently using your server generated pdf workflow is all on you. This is just a concept example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;'esri/tasks/PrintTemplate',
'esri/tasks/PrintParameters',
'esri/tasks/PrintTask',
'dojo/dom-construct',


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Hide the maps info window
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.map.infoWindow.hide();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var oWid = this.map.width;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var oHgt = this.map.height;
&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var printTask = new PrintTask('&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://your" rel="nofollow noopener noreferrer" target="_blank"&gt;http://your&lt;/A&gt;&lt;SPAN&gt; server/arcgis/rest/services/ExportWebMap/GPServer/your servers Export Web Map task');&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var template = new PrintTemplate();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //my calculation to maintain the maps aspect ratio and still have good resolution in output
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.imgHeight = (740/oWid) * oHgt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.exportOptions = {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 1542,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: (1542/oWid) * oHgt,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dpi: 200
&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; template.format = "jpg";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.layout = "MAP_ONLY";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.preserveScale = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.showAttribution = false;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var params = new PrintParameters();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; params.map = this.map;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; params.template = template;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printTask.execute(params, lang.hitch(this, this.printResult));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //I place a div that will be a place holder for the map image and have a image inside it that indicates work is in progress
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var map = domConstruct.toDom('&amp;lt;div id="mapImgDiv" style="height:400px;width:740px;border:solid 1px black;background-color:lightgray;"&amp;gt;&amp;lt;div style="width:100%;height:100%;position:relative;"&amp;gt;&amp;lt;div class="loading-container"&amp;gt;&amp;lt;img src="images/downloading.gif"/&amp;gt;&amp;lt;p&amp;gt;Retrieving Print Quality Map Image...&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; domConstruct.place(map, dom.byId('main'), 'last');

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //in the printResult function I replace the temp map div in the dom with the returned map image
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printResult: function(rsltURL){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var mapImg = domConstruct.toDom('&amp;lt;img src="'+rsltURL.url+'" border="0" style="width:740px;height:'+this.imgHeight+'px;"/&amp;gt;');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; domConstruct.place(mapImg, dom.byId('mapImgDiv'), 'replace');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:01:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/create-pdf-using-attribute-data/m-p/789050#M3917</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T09:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create Pdf using attribute data</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/create-pdf-using-attribute-data/m-p/789051#M3918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Robert,&lt;/P&gt;&lt;P&gt;Thanks for your reply will go through it and will update you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shafi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 05:27:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/create-pdf-using-attribute-data/m-p/789051#M3918</guid>
      <dc:creator>shafitrumboo</dc:creator>
      <dc:date>2015-06-15T05:27:34Z</dc:date>
    </item>
  </channel>
</rss>

