Moxi Media Inc.
<print-config> Discussion Forum

IMF Developer's Guide » Print Configuration » <print-config>  

A print configuration XML file is used to define map templates that are available for printing high quality PDF format maps in your IMF application. A map template contains information about the map surround and other items that lay out your map.

The print configuration method of defining map templates is available in IMF version 4.0.6.12 and later.

The print configuration file can contain multiple templates. Each template can be a different page size and contain different map surrounds, text, and logos. If the supporting ArcIMS service is defined with higher memory limits than the default, large-format high-resolution maps are possible.

In order to use the template based print configuration, you must create a print configuration file then refer to the URL location of the print configuration file in your site configuration file using the <print-config-xml> element like the following example:

<print-config-xml url="print.xml"/>
To add a button to your toolbar so the user can open the proper request form for selecting a print template, also add the following to your site configuration file within a <toolset> element:
<button name="Print Map"
        url="$FRAMEWORK/imfPrintMapTemplateForm.jsp"
        target="dataFrame"
        hint="Print Map"
	help="$FRAMEWORK/help/printMapButton.txt"
	status="Prepares a scaled map in PDF format."
	graphic="$FRAMEWORK/tools/print_1.gif"
	width="16" height="16"/>

The <print-config> element is the topmost tag of a print configuration XML file. The elements of the print configuration file must be enclosed in a <print-config> element tag:

<?xml version="1.0" encoding="UTF-8"?>
<print-config>
<!-- all your configuration stuff goes here -->
</print-config>

For best results, and to avoid making errors when working with the configuration files, use an XML editing tool like XMLSPY to create, edit, and validate your XML against the schema for this file format. When using a validation tool, note the the elements must appear in the sequence below.

The schema for the site configuration XML is located at:

Your XML documents can be validated against the schema on Moxi Media's server, or a copy of the file installed on yours. To specify that the file be validated when working with an XML editor, use the following format:
<?xml version="1.0" encoding="UTF-8"?>
<site-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:noNamespaceSchemaLocation="http://www.moximedia.com/imf406/print-config.xsd">
<!-- all your configuration stuff goes here -->
</site-config>
Note that you can use a file location for the schema reference instead of a URL.

Frequency Child Elements
RS+ <scale>
RS+ <resolution>
RS+ <template>
   

Frequency Description (in this context)
RS+ The child element must appear one or more times in the sequence specified.
   

Example:

<?xml version="1.0" encoding="UTF-8"?>
<print-config>
  <scale description="Current extent" value="0" default="true"/>
  <scale description="Current scale" value="-1"/>
  <scale description="1:5,000" value="5000"/>
  <scale description="1:10,000" value="10000"/>
  <scale description="1:20,000" value="20000"/>
  <scale description="1:50,000" value="50000"/>
  <scale description="1:100,000" value="100000"/>
  <scale description="1:250,000" value="250000"/>
  <scale description="1:1,000,000" value="1000000"/>
  <scale description="1:2,500,000" value="2500000"/>
  <scale description="1:5,000,000" value="5000000"/>
  <resolution description="High" value="216"/>
  <resolution description="Medium" value="144"/>
  <resolution description="Low" value="72"/>
  <template name="8.5 x 11" units="points" page-size="792,612" border-width="20">
    <!-- main page border -->
    <box position="20,20" size="752,572" outline-width="1"/>
    <!-- title border and contents -->
    <image position="22,553" url="$FRAMEWORK/images/bc/bcsigc_p.png" size="100,41"/>
    <titletext position="386,564" font="helvetica_bold" alignment="center" font-size="16" default="maps.gov.bc.ca"/>
    <box position="22,556" size="748,34"/>
    <!-- bottom box area and contents -->
    <box position="22,22" size="748,40"/>
    <paragraph position="24,26" size="340,36" font="helvetica" font-size="9" line-height="12" text="CAUTION: Maps obtained using this site are not designed to assist in navigation. These maps may be generalized and may not reflect current conditions. Uncharted hazards may exist. DO NOT USE THIS MAP FOR NAVIGATIONAL PURPOSES."/>
    <scaletext position="768,50" font="helvetica" font-size="9" prefix="Scale 1:" alignment="right"/>
    <text position="768,38" font="helvetica" font-size="9" text="Ministry of Sustainable Resource Management" alignment="right"/>
    <datetext position="768,26" prefix="Printed: " font="helvetica" font-size="9" format="datetime_medium" alignment="right"/>
    <northarrow position="460,24" size="30,30" url="$FRAMEWORK/images/northarrow4.png"/>
    <!-- legend area -->
    <box position="594,64" size="175,490" outline-width="1"/>
    <legend position="595,242" size="173,310" dpi="144"/>
    <line from="594,240" to="769,240" width="1"/>
    <indexmap position="595,65" size="173,173" dpi="216"/>
    <!-- map box and image -->
    <map position="22,64" size="570,490"/>
    <box position="22,64" size="570,490" outline-width="1"/>
    <!-- draw center coordinate text over the map -->
    <centercoordinatetext position="587,69" font="helvetica" font-size="9" alignment="right"/>
  </template>
</print-config>