Print Plus Widget Version 1.1.6 July 12, 2015

53467
184
04-06-2015 01:14 PM
Labels (1)

Print Plus Widget Version 1.1.6 July 12, 2015

2/18/2017 - updated download links

This widget is an enhancement of the Esri Print Widget, which was originally written by David Spriggs.

Live Preview Site

Bug Fixes and Enhancements in Version 1.1.6

  1. Fixed a bug (Esri's) that caused the legend in the print file to be incomplete.

Bug Fixes and Enhancements in Version 1.1.5

  1. Added a check for LODs in the main config.json so they can be restored after printing.
  2. Added a setting folder that tells the user the config file must be edited in a text editor.
  3. Adjusted the margins and labels on the widget to keep the checkboxes from wrapping.
  4. Added a red line on the scale slider to show the largest basemap scale.
  5. Fixed a bug in that caused feature layers to not print.
  6. Updated the widget layout.
  7. Added an error icon to print results when there was an error.
  8. Fixed the legend on the print layout to eliminate entries for graphics layers.

Bug Fixes in Version 1.1.4

  1. Fixed a bug that caused a zoom to the wrong scale when printing when the main config.json included map LODs..
  2. Changed all instances of _widgetOpacityMixin* to _WidgetOpacityMixin*.
  3. Changed all instances of _widgetMetadataMixin* to _WidgetMetadataMixin*.

Bug Fixes in Version 1.1.3

  1. Fixed the legend on the print layout to eliminate the "overide" entries.
  2. Tested with geographic coordinate system and fixed associated bugs.
  3. Modified the Mixin Class to destroy itself when the host widget is destroyed.
  4. Made the layout close button bigger and fixed a bug showing the layout at largest scale.

Bug Fixes in Version 1.1.2

  1. Fixed the _WidgetMetadataMixin so it would work with FireFox and IE as well as Chrome.
  2. Fixed the _WidgetOpacityMixin so it would work with FireFox and IE as well as Chrome.
  3. Updated the Live Preview Site.

Enhancements and Changes in Version 1.1.1

  1. Fixed a bug in the widget referencing _WidgetOpacityMixin in the wrong location.
  2. Made the Close button on the Widget Opacity Slider larger (smart phones needed this).
  3. Added the _WidgetMetadataMixin to the widget.  Allows you to Alt-Click the widget header and see the version information.

Features:

  1. The map layout is shown on the screen, so you don't have to guess what will be written to the print file.
  2. There is a scale dropdown and a scale slider.  Either can be used to adjust the scale of the output.
  3. The map can be panned relative to the layout by panning inside the layout.
  4. If you choose to make companion layout templates with no title block, these can be invoked by unchecking the Title Block checkbox.  You have to put these companion templates on your server.  There is a set of companion templates that match the default templates that you can download below.
  5. The Advanced dropdown is context sensitive and does not show options that don't make sense (e.g. Author, Copyright, and legend if you are not using a title block.)
  6. You can configure aliases for the layout names.
  7. When using "Just the Map" layout (alias for MAP_ONLY), there are new options on the Advanced dropdown:
    1. Preserve map scale or map extent
    2. Size of the paper to use (in inches or centimeters)
    3. A visual showing what will be printed compared to the map extent in the browser window
  8. A Widget Opacity Control in the widget header.  This controls the opacity of the Widget when the mouse is over the map.  The opacity is always 1.0 when the mouse is over the Widget.  This allows you to see the map "through" the widget and can be very handy on a small mobile device (e.g. smart phone).

Downloads:

PrintPlus-1.1.6-2015-7-12.zip

CompanionLayoutsWithNoTitleBlocks.zip

PrintPlus-1.1.6-2015-7-12 (download - widget by Larry Stout) 

https://community.esri.com/docs/DOC-9629-companionlayoutswithnotitleblocks-download-widget-by-larry-... 

Larrys Custom WAB Widgets and More

Labels (1)
Comments

Hi

I am trying to integrate the same widget for Non WAB application. I am able to integrate it with some of the errors.

1) My print area is coming less than shown in Map sheet.

2) un-checking the Title block check box gives error in print  .

Can Anyone help me with this. I am not able to figure it out

Larry StoutJian HuangCollin WelbonRebecca StrauchSolomon NimakoRobert Scheitlin, GISP

Thanks in advance

Saurabh

Hi Roger

Were u able to get the solution for your problem of cropping.

Thanks

Hi David

Any luck in finding the solution to your problem?

Thanks

Nope   Still doesn't work correctly for me so using standard Print widget until somebody else figures this one out.

Anyone try to modify the 'config_Print Plus.json' in WAB 2.1 in order to change the default names? I get a 'Parse JSON error' if i change even one letter in the   "defaultTitle": "ArcGIS WebMap", line.

Mikkel Hylden Did you ever get this figured out? I seem to have scaling issues at version 1.6

Unfortunately, no – I gave up on the PrintPlus widget for the time being.

Mikkel

Mikkel Hylden

I believe I have found the answer in printplus.js

Change :

this.printparams.outSpatialReference = this.map.spatialReference; 

to this:

this.printparams.outSpatialReference = new esri.SpatialReference({wkid:yourwkid}); 

You will need to also add

require(["esri/SpatialReference"], function(SpatialReference)

in the appropriate sections.

You will then need to change the size of the page in the config. I went from around 8.5x11 to 11.65x14.8

Thanks Rickey – I’ll give that a try when I have some spare time.

Mikkel

Hi Robert, ( rscheitlin‌  )

I am having issues downloading your PrintPlus Widget  #PrintPlus  😞

Error Code 10060

ftp://ftp.hamiltoncounty.in.gov/GIS/AWAB/PrintPlus-1.1.6-2015-7-12.zip

Any alternative ?

Thanks Robert ...

Reginaldo,

   This one is not mine and is no longer supported due to owner taking another job. The alternative is to use the OTB print widget.

hi robert,

oh i see ... 

thanks for d info ....

best regards ,

eggie

I am getting this weird issue where the widget will not fully load in chrome. It had worked previously then for some reason it randomly stops working. I have not changed the app in any way. 

The only way I can get it working again is to go to the internal server and load the app. I then go back to the public one, refresh, and the print widget loads like it should. 

Has anyone seen anything like this or has an idea of why this might happen. 

The code in both spots are exactly the same. 

Rickey,

   It is the Chrome 51 & 52 print widget issue mentioned in these threads:

Problem in production after Upgrade of Google Chrome to chrome 52.0.2743.82 

https://community.esri.com/thread/181102 

Is there a way to remove the option and check box of "Include Legend?"  In the advanced tab?

Rudie,

  Sure in the templates\PrintPlus.html edit this code block:

          <div id="includeLegend" style="display: none;" data-dojo-type="dijit/form/Form" data-dojo-attach-point="layoutFormDijit"><!-- lcs Print Enhancements - added id -->
            <table cellspacing="5">
              <tr>
                <td>
                  ${nls.lncludeLegend}:
                </td>
                <td>
                  <input type="checkbox" data-dojo-type="dijit/form/CheckBox" data-dojo-props="name:'legend',value:true,checked:false"/>
                </td>
              </tr>
            </table>
          </div>

Hi Larry, 

This is a great widget.  I am not that familiar with editing config.json files but is there a way to comment out the author and make the copywrite non-configurable?

I was able to add a template mxd the same way you described above.

Thanks, 

Chelsea

Has anyone found a better way to handle Legend items within a print widget?

Hi,

Great widget. The layout box is really a great tool for uses to interact with the map. One question. How would I modify the relativeScaleFactor, scalePrecision, and map scales array to more closely match the esri World_Topo_Map service? I'm trying to achieve a more "what you see is what you get" output with the layout. Meaning the map extent shown in the layout box is basically what will be displayed on the associated printout. I've tried changing the scales in the map scales array to match the scales in the World_Topo_Map service, but haven't had much luck with the output. Seems like it always zooms in and cuts some of the map extent out. Is what I'm asking even possible?

(Probably getting tripped up on a fundamental geographic concept here)

Matt

Hi Larry!

Firs of all, thank you so much for this widget. It is a great job! I'm using it and I realized that the extent of my final layout (in a .pdf file) does not match with the map layout shown in the screen. Did you realize it? Do you know the reason?

Regards,

Eliseo Carrillo

eliseo.carrillo    Larry is most likely not monitoring this thread anymore since he took a different job a while back.  You may want to start a new question/post with your question.

https://community.esri.com/community/help-and-feedback/blog/2016/08/15/community-news-and-tips-how-t...

David,

It's been a few years, but did you find a resolution to this? The PrintPlus widget was not providing the tick marks or the red box, among other things. I'm having the exact same issue and just can't work around it. Thanks!

Hi Robert,

I replaced the includeLegend div with this code block. It does work that the include Legend option is now unchecked in  Advanced , but the legend still shows up in the print out, and no matter the Include Legend option checked or not. Seems like this div code block only changes the display of the option, any suggestions?

Thanks!

KP

KP,

   In my response to Rudie I was only addressing how to remove the legend option from the widgets UI. I don't personally use this widget so I can not really answer your question.

Hi Larry,

I'm experiencing a scale related issue with this widget. I integrated this widget with our 10.5 server (is versioning a issue here ? 10.3 seems to work just fine)

An example is attached with these two pics. The left pic is what it shows on the frame, and the right side is the print. This issue happens whenever I tried to switch from the default paper size to any other page type.

I hope you can point me to a right direction to fix this issue.

Thanks Larry,

KP

PS: Sorry just realized that Larry is not monitoring this post anymore. However this reply can be an info-sharing and hope to see solutions on this! Thanks!

Dear Larry Stout,

This is great work. Is there a way to add organization logo to print output?

Thanks,

Azghar

Do we know if this widget works in 10.6?  

Kipo Kipo‌ : Have you ever found a solution for your Problem? I have the same at the moment - everything works fine with default layout but as soon as I switch to another layout the print extent is no longer correct.

Unfortunately no, I have to give up on this widget and roll back to the

standard one. KP

Ok, I think I found out why it did not work for me:

My Map uses Web Mercator. There is a function that calls the geometry service to determine the parameters to project the layout correctly. However this function was only called on startup. So it only worked for the default layout. If you copy the below section into the function _onLayoutChange all the other layouts work correct, too:

if (this.showLayout) {
            this.mapUnitsToMeters.x = this.mapUnitsToMeters.y = scaleUtils.getUnitValueForSR(this.map.spatialReference);
            if (!this.mapUnitsToMeters.x) {
              // We cannot determine the map units, so don't show the layout.
              this.showLayout = false;
            } else if (this.mapUnitsToMeters.x > 10000 || this.map.spatialReference.isWebMercator()) {
              // If the spatial reference is geographic or Web Mercator, call the geometry service to get the parameters to project the layout onto the map.  
              // This is an approximation, but adequate for small geographic areas (e.g. Hamilton County, IN - 400 Square miles)
              // TODO: Check the map area to see if an approximation makes sense
              var e = this.map.extent;  // TODO: change this to get the initial extent???
              var lineN = new Polyline(this.map.spatialReference);
              lineN.addPath([[e.xmin, e.ymax], [e.xmax, e.ymax]]);
              var lineS = new Polyline(this.map.spatialReference);
              lineS.addPath([[e.xmin, e.ymin], [e.xmax, e.ymin]]);
              var lineE = new Polyline(this.map.spatialReference);
              lineE.addPath([[e.xmax, e.ymax], [e.xmax, e.ymin]]);
              var lineW = new Polyline(this.map.spatialReference);
              lineW.addPath([[e.xmin, e.ymax], [e.xmin, e.ymin]]);
              var eDims = { x: e.getWidth(), y: e.getHeight() };
              var lp = new LengthsParameters();
              lp.polylines = [lineN, lineS, lineE, lineW];
              lp.lengthUnit = esri.tasks.GeometryService.UNIT_METER;
              lp.geodesic = true;
              esriConfig.defaults.geometryService.lengths(lp,
                lang.hitch(this, function(result) {
                  if (result.lengths.length === 4) {
                    var southRatio = (result.lengths[0] / eDims.x);
                    var northRatio = (result.lengths[1] / eDims.x);
                    var westRatio  = (result.lengths[2] / eDims.y);
                    var eastRatio  = (result.lengths[3] / eDims.y);
                    // TODO: put in a check to fail if the ratios are too different?
                    // var variation = [Math.abs(1 - (southRatio / northRatio)), Math.abs(1 - (westRatio / eastRatio))];
                    //console.log('variation:', variation);
                    this.mapUnitsToMeters.x *= (southRatio + northRatio) / 2;
                    this.mapUnitsToMeters.y *= (westRatio + eastRatio) / 2;
                    console.log("this.mapUnitsToMeters_layoutChange", this.mapUnitsToMeters.x ,this.mapUnitsToMeters.y);
                  } else {
                    this.showLayout = false;
                    console.error("Get Map Units to Layout Units Conversion Factors");
                    console.error("Calculating conversion factors failed.  Print layouts will not be shown on the map.");
                  }
                }),
                lang.hitch(this, function() {
                  this.showLayout = false;
                  console.error("Get Map Units to Layout Units Conversion Factors");
                  console.error("Calculating conversion factors failed.  Print layouts will not be shown on the map.");
                })
              );
            }
          }

Unfortunately I still have a problem with vector tile basemaps, that don`t display correctly. As with the above, they work finde in default layout, all the other somehow get cut off. I am not shure though if this is because of 10.5.1 or because of the app 😕

Vector Basemap Problem

Hi Larry! Nice widget. Is it possible to print in .bmp??? 

Have a nice weekend

/Sanne

Hello

Do you find a solution to this problem ?

I still use this widget and I have this problem that all the elements are visible in the layout legend, while use with the standard print widget is correct

for information I have to use this widget to display the print area.

Jacques

@SarahHeld1 

Thanks this solution to the problem, where everything works correct with the default layout, but not, when change this. Your modification did the job, when change the layout, I can print, what I see. But did you discover, that the scale is not correct with it? When I'm in 1:2000 scale, the 1:2000 layout is smaller, than the view, and it will be not correct. It was ok, before modify it, but not correct at startup. So.. when start the widget, I can print, what I see, but not correct scale, and when change layout, it will correct scale, but not correct view.... Can anyone help in it?

Thanks.

Version history
Last update:
‎04-06-2015 01:14 PM
Updated by:
Contributors