Antwort: [mapserver-dev] PDF support wrap up...

Dan Little danlittle at yahoo.com
Wed Jan 21 12:33:53 EST 2009


To quote the originator of the thread, "that sounds like a job for MapScript." ;)

IMO, having Mapserver draw into a PDF is fantastic.  However, I think it's rendering should be limited to exactly that -- drawing the map into the PDF.  Allow the driver to specify format options to place the map in the page and specify page size.  Mapscript could foreseeably even change the driver/format options dynamically to allow for the map to be moved depending on user input.  There may need to be some more information to work on specifying Legend and Scalebar placements... but I'm running with an idea right now so everyone bear with me...

Then either allow the PDF to be serialized and consumed by another PDF library, or simply written to a temp directory on disk and then opened.    This model would work in any of the popular scripting languages (PHP, Python, Perl, Ruby, probably Java but I've never used it for such a purpose) and it would keep the role of mapserver and the complexity of the PDF rendering to a minimal.  This also allows folks to do WHATEVER they want with the PDF output.  I'm thinking the code would universally follow this type of pattern...

* Get User Input
* Set Map Size/Placement/Layers, etc. based on Input
* Save the PDF
* Open PDF with native library
* Add markup and decoration (titles, info, north arrows, etc.)
* Return PDF to the user via a preferred method.

I would envision a simple script which adds a page title to be no more than 30 lines long.



----- Original Message ----
> From: Peter Hopfgartner <peter.hopfgartner at r3-gis.com>
> To: umn-ms at hydrotec.de
> Cc: mapserver-dev at lists.osgeo.org
> Sent: Wednesday, January 21, 2009 2:12:27 AM
> Subject: Re: Antwort: [mapserver-dev] PDF support wrap up...
> 
> umn-ms at hydrotec.de wrote:
> >
> > > ... I'd like to hear more about opportunities to integrate 
> > MapServer-based
> > > PDF output into more complex layouts. Ultimately that's what people
> > > want to do. How are folks doing that?
> >
> > In some apps we create PDF with Java, XSLT an Apache/FOP.
> > * Spatial and non-spatial Data in relational Database
> > * Mapserver: Creates PNG-Map from Database
> > * Java: Create XML from Database
> > * XSLT: Create XSL-FO from XML (links to PNG)
> > * Apache-FOP: Create PDF from XML  (embedd PNG)
> >
> Hi,
> 
> we are (almost) doing the same. Only, that we use PHP for the XML 
> generation. We did some experiment using SVG for the map. Anyway, there 
> might be some enormous improvement once that the Cairo renderer is ready.
> > Experience:
> > + Can tweak layout
> > + Map with true scale
> > + Can show additional Database Data in PDF around the map
> > + Standardized techniques
> > - Apache FOP may run out of memory
> >
> Same here. Could the memory problem be solved compiling fop ahead of 
> time into native code with GCJ? Any experience?
> 
> Regards,
> 
> Peter
> > I can hardly imagine, that a mapserver-only-solution could create
> > a customized quality-map.
> >
> > Benedikt Rothe
> >
> >              Database
> >              /       \
> >             |         |
> >      Java   |         |
> >             V         |
> >            XML        | Mapserver
> >             |         |
> >             |XSLT     |
> >             V         V
> >          XSL-FO     Map As PNG
> >             |         |
> > Apache-FOP  |         |
> >             V         |
> >            PDF  <------
> >
> > mapserver-dev-bounces at lists.osgeo.org schrieb am 21.01.2009 04:41:04:
> >
> > > Brent et al... Lot's of good discussion in the recent PDF thread but
> > > I'm not sure there was
> > > any decision made. My opinions changed as ideas came forth. I'm in
> > > the "keep MapServer
> > > as simple as possible" camp. I'd like to hear more about
> > > opportunities to integrate MapServer-based
> > > PDF output into more complex layouts. Ultimately that's what people
> > > want to do. How are
> > > folks doing that?
> > >
> > > Steve
> > > _______________________________________________
> > > mapserver-dev mailing list
> > > mapserver-dev at lists.osgeo.org
> > > http://lists.osgeo.org/mailman/listinfo/mapserver-dev
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > mapserver-dev mailing list
> > mapserver-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-dev
> >  
> 
> 
> -- 
> 
> Dott. Peter Hopfgartner
> 
> R3 GIS Srl - GmbH
> Via Johann Kravogl-Str. 2
> I-39012 Meran/Merano (BZ)
> Email: peter.hopfgartner at r3-gis.com
> Tel. : +39 0473 494949
> Fax  : +39 0473 069902
> www  : http://www.r3-gis.com
> 
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev



      


More information about the mapserver-dev mailing list