printPDF

Description

Mapbender print PDF with PDF templates module.

Files

  • http/plugins/mb_print.php
  • http/print/classes
  • http/print/printFactory.php
  • http/print/printPDF_download.php
  • lib/printbox.js

SQL

INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment,
e_title, e_element, e_src, e_attributes, e_left, e_top, e_width,
e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file,
e_mb_mod, e_target, e_requires, e_url) VALUES('<appId>','printPDF',
2,1,'pdf print','Print','div','','',1,1,2,2,5,'',
'<div id="printPDF_working_bg"></div><div id="printPDF_working"><img src="../img/indicator_wheel.gif" style="padding:10px 0 0 10px">Generating PDF</div><div id="printPDF_input"><form id="printPDF_form" action="../print/printFactory.php"><div id="printPDF_selector"></div><div class="print_option"><input type="hidden" id="map_url" name="map_url" value=""/><input type="hidden" id="legend_url" name="legend_url" value=""/><input type="hidden" id="overview_url" name="overview_url" value=""/><input type="hidden" id="map_scale" name="map_scale" value=""/><input type="hidden" name="measured_x_values" /><input type="hidden" name="measured_y_values" /><br /></div><div class="print_option" id="printPDF_formsubmit"><input id="submit" type="submit" value="Print"><br /></div></form><div id="printPDF_result"></div></div>',
'div','../plugins/mb_print.php',
'../../lib/printbox.js,../extensions/jquery-ui-1.7.2.custom/development-bundle/external/bgiframe/jquery.bgiframe.min.js,../extensions/jquery.form.min.js',
'mapframe1','','http://www.mapbender.org/index.php/Print');

INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name,
var_value, context, var_type) VALUES('<appId>', 'printPDF',
'mbPrintConfig', '{"Standard": "mapbender_template.json"}', '' ,'var');

INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name,
var_value, context, var_type) VALUES('<appId>', 'body',
'print_css', '../css/print_div.css', '' ,'file/css');

Help

http://www.mapbender.org/PrintPDF_with_template

Maintainer

http://www.mapbender.org/User:Michael_Schulz http://www.mapbender.org/User:Christoph_Baudson

Parameters

mbPrintConfig[optional] object with name and filename of template, like { “Standard”: “a_template.json”, “Different”: “another_template.json” }

License

Copyright © 2009, Open Source Geospatial Foundation This program is dual licensed under the GNU General Public License and Simplified BSD license.  http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt

Summary
printPDFMapbender print PDF with PDF templates module.
Properties
actualConfigobject, holds the actual configuration after loading the json file
printBoxthe movable printframe
Functions
createPrintBoxcreates a printBox in the current view, calculates the scale (tbd.
getPDFMapSizechecks the actual config for the size w/h values.
destroyPrintBoxremoves an existing printBox.
mod_printPDF_initinitializes the print modules, generates template chooser and loads first configuration.
loadConfigGETs the config, build corresponding form, remove an existing printBox
hookFormutility method to connect the form plugin to the print form.
showResultload the generated PDF from the returned URL as an attachment, that triggers a download popup or is displayed in PDF plugin.

Properties

actualConfig

object, holds the actual configuration after loading the json file

printBox

the movable printframe

Functions

createPrintBox

this.createPrintBox = function ()

creates a printBox in the current view, calculates the scale (tbd. if not set from the config) so that the printbox fits in the mapframe.  Width and height are taken from the configuration.

getPDFMapSize

var getPDFMapSize = function (key)

checks the actual config for the size w/h values.

Parameters

keystring, the key which value to retrieve (currently width or height)

destroyPrintBox

var destroyPrintBox = function ()

removes an existing printBox.

mod_printPDF_init

var mod_printPDF_init = function ()

initializes the print modules, generates template chooser and loads first configuration.

loadConfig

this.loadConfig = function (configFilename,
callback)

GETs the config, build corresponding form, remove an existing printBox

hookForm

var hookForm = function ()

utility method to connect the form plugin to the print form.

showResult

var showResult = function (res,
text)

load the generated PDF from the returned URL as an attachment, that triggers a download popup or is displayed in PDF plugin.

this.createPrintBox = function ()
creates a printBox in the current view, calculates the scale (tbd.
var getPDFMapSize = function (key)
checks the actual config for the size w/h values.
var destroyPrintBox = function ()
removes an existing printBox.
var mod_printPDF_init = function ()
initializes the print modules, generates template chooser and loads first configuration.
this.loadConfig = function (configFilename,
callback)
GETs the config, build corresponding form, remove an existing printBox
var hookForm = function ()
utility method to connect the form plugin to the print form.
var showResult = function (res,
text)
load the generated PDF from the returned URL as an attachment, that triggers a download popup or is displayed in PDF plugin.
Close