Talk:Print
From MapbenderWiki
Contents |
Mapbender PDF generation
Dynamic PDF generation
- the current way of printing with mapbender
PDF generation with templates
Summary
In addition to the current print PDF functionality, we want to enhance usability by using a pdf template mechanism provided by the FPDF/FPDI libraries. It will be possible to place certain elements, like the map, overview, scalebar, north arrow, etc. onto a user provided pdf template, allowing for e.g. sophisticated graphical pdf layouts.
Links
- FPDF Library
- FPDI Import existing PDF documents into FPDF
- maybe an alternative but the idea is not followed anymore mapbender_pdf-print_with_xml/xslt - Print workgroup
Have a look at GeoEXT and Mapfish
- http://demo.mapfish.org/mapfishsample/trunk/examples/print/simple.html
- http://www.geoext.org/trac/geoext
- http://mapfishblog.blogspot.com/2008/12/new-way-to-print-map.html
What do we need
- conf file for
- definition of available formats and paper sizes (depends on available templates)
- defining which elements should be shown in the PDF (map, overview, scalebar, different texts etc.)
- definition of size and position of all print elements
- PDF templates
- create some standard templates for all standard formats and paper sizes
- create own templates
- we should think about an easy way to create new templates for the users
- integration of lib FPDF/FPDI into Mapbender
- directory in mapbender/http/extensions
- edit mod_printPDF_pdf.php
- edit script, integrate FPDF/FPDI functionality, check which existing functionality can be used further more
What else
- if opactity in the Client is defined use opacity in the print aswell
Client side functionality
- show the area which will be printed in the client as a rectangle (define the scale, rotation)
- possibility to rotate the print area (offer a rotation file where you can insert a rotalion as an integer 0-360 - or only -45 to 90 ?)
- multiple print (define more then one area for printing) - result in one pdf or one pdf for each area, define the name, title, comment for each area
- save multiple print defenition, so you can load this configuration at a later stage and print the same areas again
- for inspiration have a look at
Print Administration
- offer a print-editor to create an individual print layout (application to define a layout via drag & drop)
Implementation
- put fpdf/fpdi libs in /http/classes/fpdf
- discuss pdf template configuration
Combine dynamic and template driven PDF generation?
Design
In a recent discussion with Christoph, he mentioned the use of patterns and in this case the factory pattern and decorator pattern. Maybe this approach cold be used to combine both ways. I've sketched a simple class structure, that may serve as a basis for some discussion.

