1

( I asked this same question on ArcGIS forums, with no response...I hope someone here can help!)

I am using ArcView, ArcServer 10.0 and the JS API v3.1 (so no print function) ... I have an app where the user chooses parameters from a few dropdown menus, and a print-friendly map page opens in a new tab. From this page, the user can click a 'print' button, which uses window.print() to open the browser's print dialog. I have a print.css page, which is working well with my 'normal' divs, text and images. I have this tag in my HTML:

<link rel="stylesheet" href="print.css" type="text/css" media="print" />

My problem is that I cannot seem to reset the size of the Dojo map object. The map in my printed page (or PDF, if I choose CutePDF) is the same size as whatever the size was in the print-friendly page. I would like my print.css to hard define the printed version / PDF as an exact height and width, regardless of the window size in the print-friendly page. I cannot define the size of page to be printed in the print-friendly page, b/c for one, my client would like to pan and zoom the map after the print-friendly page is generated. I have no problem setting the size of the other elements in my print.css rules (text box, hard coded legend with images)...but any rules I try to set for the map itself in my print.css page are ignored.

I tried using 'exportMapImage', thinking that maybe I could make an image of the map and its contents, but this loses the basemap which I need, and also I do not want the user to open yet another page or tab. (I am having the same problem with my scalebar, but I this isn't so important for this project).

My goal is to create a PDF or printed page that is the same size no matter what the screen size or current window size., and I have it working except for the map itself.

Any ideas? I hope I explained my problem clearly. Thanks , J

Also, I am hoping to find a client-side solution; I don't have much experience with server-side programming. If this can't happen, please let me know any server-side ideas, thanks!)

4
  • 1
    Upgrading to ArcGIS 10.1 (or 10.2) may or may not be an option for you but, if you are not aware of it, that version addressed Advanced printing for web maps.
    – PolyGeo
    Commented Aug 1, 2013 at 22:30
  • Are you able to provide a link to your ArcGIS Discussion Forum posting? That way anyone looking to answer can benefit from any advice offered there before covering the same ground.
    – PolyGeo
    Commented Aug 2, 2013 at 0:14
  • yes, here it is: link...sorry I should have added that right away. As far as ArcServer 10.1, sadly I don't think we will be getting this anytime soon, so I am stuck with 10.0. I am aware of the new print functionality, but I can't use it. This has been a bit frustrating for me, as hard-coding the css for the other div elements to make a print-friendly page is quite easy.
    – JasonBK
    Commented Aug 2, 2013 at 14:46
  • I realized that one issue here was that I was tryong to display a landscape oriented print view, which was cauing problems in IE. The 'Shrink To Fit' option always tried to frame the page in portrait mode. I have read that this is a known issue on IE 9 and below.
    – JasonBK
    Commented Mar 25, 2014 at 12:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.