Skip to content

Print Plugin

tdipisa edited this page Oct 23, 2012 · 6 revisions

How to enable the plugin

In order to enable the print plugin follow this simple steps:

  1. Download GeoServer with the print plugin following the installation instruction in the official web documentation

  2. Go to the:

        you@prompt:~$ mapstore/mapcomposer/app/static/externals/PrintPreview/examples
    
  3. Copy the 'Arrow_North_CFCF.svg' and the 'print_header.png' files inside the following directory:

        you@prompt:~$ GEOSERVER_DATA_DIR/www/print
    
  4. Copy the 'config.yaml' file inside the following directory:

        you@prompt:~$ GEOSERVER_DATA_DIR/printing
    
  5. Enable the print plugin script import inside the composer.html/viewer.html files by decommenting this code fragment:

     <!-- PrintPreview resources 
     <link rel="stylesheet" type="text/css" href="externals/PrintPreview/resources/css/printpreview.css">
     <script type="text/javascript" src="script/PrintPreview.js"></script> -->
    

Needed files in build Config

  • GeoExt/plugins/PrintPageField.js
  • GeoExt/plugins/PrintProviderField.js
  • GeoExt/widgets/PrintMapPanel.js
  • plugins/Print.js
  • app/static/externals/PrintPreview/lib/GeoExt.ux/PrintPreview.js

Notes about protectred data

Print plugin uses Wms GetMap requests to compose the map. So the servers under basic authentication protection must have an exception to allow the geoserver instance using the print plugin functionality to send requests. Exemple configuration for Apache2:

    <Location /protected>
        AuthType Basic
        AuthName acque-access
        AuthUserFile /etc/apache2/passwd/protected
        Require valid-user
        Order allow,deny
        Allow from 217.133.17.186    #proxy address 
        Satisfy any
    </Location>

##Configuration

configuration exemple:

   {
	  "ptype":"gxp_print",
	  "customParams":{
		 "outputFilename":"mapstore-print"
	  },
	  "printService":"http://192.168.1.43:8080/acque/geoserver/pdf/",
	  "legendPanelId":"legendPanel",
	  "actionTarget":{
		 "target":"paneltbar",
		 "index":4
	  }
   }

Clone this wiki locally