<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.osgeo.org/w/index.php?action=history&amp;feed=atom&amp;title=Layout_Specification</id>
	<title>Layout Specification - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.osgeo.org/w/index.php?action=history&amp;feed=atom&amp;title=Layout_Specification"/>
	<link rel="alternate" type="text/html" href="https://wiki.osgeo.org/w/index.php?title=Layout_Specification&amp;action=history"/>
	<updated>2026-04-12T09:49:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.9</generator>
	<entry>
		<id>https://wiki.osgeo.org/w/index.php?title=Layout_Specification&amp;diff=46892&amp;oldid=prev</id>
		<title>Wiki-Pagameba: Created page with 'This is just a starting point for discussion on how to describe the layout of a print production document.   == DMSG&amp;nbsp;INI File Format  ==  This structure was developed by [ht…'</title>
		<link rel="alternate" type="text/html" href="https://wiki.osgeo.org/w/index.php?title=Layout_Specification&amp;diff=46892&amp;oldid=prev"/>
		<updated>2010-04-08T12:50:22Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;This is just a starting point for discussion on how to describe the layout of a print production document.   == DMSG INI File Format  ==  This structure was developed by [ht…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is just a starting point for discussion on how to describe the layout of a print production document. &lt;br /&gt;
&lt;br /&gt;
== DMSG&amp;amp;nbsp;INI File Format  ==&lt;br /&gt;
&lt;br /&gt;
This structure was developed by [http://dmsolutions.ca DM Solutions Group] for its [http://mapsherpa.com MapSherpa] PDF map generator. It is processed by some PHP code and a PDF is generated using [http://www.fpdf.org/ FPDF], although any PDF library could be used. [http://mapserver.org MapServer] is used. &amp;amp;nbsp;The structure could easily be converted to another format such as XML or YAML. &amp;amp;nbsp;This structure is focused on producing PDF documents from flexible templates, it is not designed to handle generic production layout tasks but it can hopefully be extended to include additional needs as they are discussed/discovered. &lt;br /&gt;
&lt;br /&gt;
Here is a [http://www.mapsherpa.com/wp-content/uploads/Mont-Tremblant-Topo.pdf sample PDF&amp;amp;nbsp;]. &lt;br /&gt;
&lt;br /&gt;
There are several concepts central to the structure: &lt;br /&gt;
&lt;br /&gt;
*an overall document section that describes the pages in the document and default style values (font face, units of measure, document metadata) &lt;br /&gt;
*page sections that describe individual pages in the document (size, orientation, margins, and style values for that page) and a list of blocks in the page &lt;br /&gt;
*blocks that are rectangular regions to be rendered on a page. &amp;amp;nbsp;Blocks have size, position, style values and a type &lt;br /&gt;
*styling uses CSS-like naming structure and values where practical &lt;br /&gt;
*Styles are inherited by child blocks when not explicitly defined in a child block &lt;br /&gt;
*all values that have units inherit the default units of the document or can have units as part of the value and are automatically converted&lt;br /&gt;
&lt;br /&gt;
=== Style Keys  ===&lt;br /&gt;
&lt;br /&gt;
any section may define the following style keys &lt;br /&gt;
&amp;lt;pre&amp;gt;font-face = DejaVuSans&lt;br /&gt;
font-size = 12pt&lt;br /&gt;
font-style = normal&lt;br /&gt;
font-weight = normal&lt;br /&gt;
text-decoration = none&lt;br /&gt;
line-height = 16pt&lt;br /&gt;
text-align = left&lt;br /&gt;
vertical-align = top&lt;br /&gt;
background-color = 255 255 255&amp;amp;nbsp;; colors are RGB 0-255&lt;br /&gt;
color = 0 0 0&lt;br /&gt;
border-color = 0 0 0&lt;br /&gt;
border-width = 0&amp;amp;nbsp;; may use two (top-bottom and left-right)&lt;br /&gt;
                &amp;amp;nbsp;; or four (top, right, bottom, left) values&lt;br /&gt;
margin = 0pt    &amp;amp;nbsp;; may use two (top-bottom and left-right)&lt;br /&gt;
                &amp;amp;nbsp;; or four (top, right, bottom, left) values&lt;br /&gt;
padding = 0pt   &amp;amp;nbsp;; may use two (top-bottom and left-right)&lt;br /&gt;
                &amp;amp;nbsp;;&amp;amp;nbsp;or four (top, right, bottom, left) values&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
In addition, you can create sections that contain common styles and refer to them directly rather than defining the styles individually in a block. &amp;amp;nbsp;It is not necessary to define all the style values, there are always default values that get inherited. &lt;br /&gt;
&amp;lt;pre&amp;gt;[DefaultStyle]&lt;br /&gt;
font-face = DejaVuSans&lt;br /&gt;
font-size = 12pt&lt;br /&gt;
font-style = normal&lt;br /&gt;
font-weight = normal&lt;br /&gt;
text-decoration = none&lt;br /&gt;
line-height = 16pt&lt;br /&gt;
text-align = left&lt;br /&gt;
vertical-align = top&lt;br /&gt;
background-color = 255 255 255&lt;br /&gt;
color = 0 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
=== Document Section  ===&lt;br /&gt;
&amp;lt;pre&amp;gt;; mandatory section called Document&lt;br /&gt;
;&lt;br /&gt;
; Document section can set default style values &lt;br /&gt;
; to be inherited by all pages/blocks either inline&lt;br /&gt;
; or by including a style = StyleBlock to point &lt;br /&gt;
; to another section that defines any or all of &lt;br /&gt;
; these styles&lt;br /&gt;
&lt;br /&gt;
[Document]&lt;br /&gt;
margin = 0&lt;br /&gt;
units = mm&lt;br /&gt;
style = DefaultStyle&lt;br /&gt;
&lt;br /&gt;
; document metadata embedded in the PDF, visible&lt;br /&gt;
; to the viewer in document info&lt;br /&gt;
creator = My Application&lt;br /&gt;
author = My Name&lt;br /&gt;
subject = My&amp;amp;nbsp;Subject&lt;br /&gt;
keywords = a list of keywords&lt;br /&gt;
&lt;br /&gt;
; pages in the Document, a quirk of PHP&amp;amp;nbsp;is that&lt;br /&gt;
; when it parses an ini file and a key contains&lt;br /&gt;
; square brackets, it converts it to an array&lt;br /&gt;
; containing values for each key thus defined&lt;br /&gt;
pages[] = Page1&lt;br /&gt;
pages[] = Page2&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
=== Page Section  ===&lt;br /&gt;
&amp;lt;pre&amp;gt;; a Page section is a page because it was referred&lt;br /&gt;
; to as such by the Document section.  There is no &lt;br /&gt;
; other identifier&lt;br /&gt;
[Page1]&lt;br /&gt;
; may define any of the style rules here and/or use&lt;br /&gt;
; a style = StyleBlock to import styles.  Any styles&lt;br /&gt;
; not explicitly set inherit the style values of the&lt;br /&gt;
; Document. &amp;amp;nbsp;The values that can be set explicitly on&lt;br /&gt;
; a page are&lt;br /&gt;
page-size = Letter&amp;amp;nbsp;; Letter, Legal, A3, A4, A5 or a&lt;br /&gt;
                  &amp;amp;nbsp;; custom size using the format&lt;br /&gt;
                  &amp;amp;nbsp;; &amp;amp;lt;width&amp;amp;gt;&amp;amp;lt;units&amp;amp;gt; &amp;amp;lt;height&amp;amp;gt;&amp;amp;lt;units&amp;amp;gt;&lt;br /&gt;
orientation = Landscape&amp;amp;nbsp;; or Portrait&lt;br /&gt;
margin = 0.5in&amp;amp;nbsp;; note we use mm for the document units&lt;br /&gt;
              &amp;amp;nbsp;; but we can set any sized value in any&lt;br /&gt;
              &amp;amp;nbsp;; unit we wish&lt;br /&gt;
; the other thing that pages contain is a list of blocks&lt;br /&gt;
; to be rendered in that page, again using the [] syntax&lt;br /&gt;
; for PHP&lt;br /&gt;
blocks[] = MapArea&lt;br /&gt;
blocks[] = LegendArea&lt;br /&gt;
blocks[] = DetailArea&lt;br /&gt;
blocks[] = AttributionArea&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
=== Block Sections  ===&lt;br /&gt;
&lt;br /&gt;
A block section has a location specified relative to its containing block, a list of blocks it contains, a type and any type-specific values. &amp;amp;nbsp;Positioning can be broken into vertical and horizontal components. &amp;amp;nbsp;Horizontally, you must specify at least two of left, width and right. If you specify left and right then the width is calculated automatically from the size of the parent, taking into consideration the margin, border, padding of the parent block. &amp;amp;nbsp;Vertically you must specify at least two of top, height and bottom. &amp;amp;nbsp;Same rules apply for height.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
Also, a block section can specify an overflow block. &amp;amp;nbsp;When content exceeds the size of a block, the extra content is then sent to the overflow block. &amp;amp;nbsp;Overflow blocks can be chained to other overflow blocks. &amp;amp;nbsp;Content continues to flow until it has been completed rendered or there are no further blocks (at which point the content is truncated). &lt;br /&gt;
&amp;lt;pre&amp;gt;[MapArea]&lt;br /&gt;
top = 0&amp;amp;nbsp;; pinned to the top of the block it is contained in&lt;br /&gt;
left = 0&amp;amp;nbsp;; pinned to the left of the block it is contained in&lt;br /&gt;
right = 2in &amp;amp;nbsp;; pinned to the right of the block it is contained in, &lt;br /&gt;
            &amp;amp;nbsp;; width is calculated automatically from the &lt;br /&gt;
bottom = 2in&amp;amp;nbsp;; pinned to the right of the block it is contained in,&lt;br /&gt;
            &amp;amp;nbsp;; width is calculated automatically from the&lt;br /&gt;
type = map  &amp;amp;nbsp;; means use the MapBlock plugin to render this block&lt;br /&gt;
map =&amp;amp;nbsp;%map% &amp;amp;nbsp;; the map file or PHP&amp;amp;nbsp;MapScript map object to use&lt;br /&gt;
            &amp;amp;nbsp;; in this case it comes from a variable that is passed&lt;br /&gt;
            &amp;amp;nbsp;; to the PDF&amp;amp;nbsp;Document rendering engine at runtime&lt;br /&gt;
resolution = 300&amp;amp;nbsp;; render the map at 300 dpi, which increases the&lt;br /&gt;
                &amp;amp;nbsp;; size in pixels of the map and scales all sizes&lt;br /&gt;
                &amp;amp;nbsp;; and widths in the map file by the appropriate&lt;br /&gt;
                &amp;amp;nbsp;; amount.  This would not be necessary if we could&lt;br /&gt;
                &amp;amp;nbsp;; get appropriate PDF vector output from MapServer&lt;br /&gt;
grid = true&amp;amp;nbsp;; render a grid surrounding the map and on the map&lt;br /&gt;
gridticksize = 1mm &lt;br /&gt;
gridstyle = [GridStyleBlock]&amp;amp;nbsp;; a style block that controls the style&lt;br /&gt;
                            &amp;amp;nbsp;; of the fonts etc when rendering the&lt;br /&gt;
                            &amp;amp;nbsp;; grid surround&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
=== Block Types  ===&lt;br /&gt;
&lt;br /&gt;
There are several block types that have been created for the DMSG layout engine &lt;br /&gt;
&lt;br /&gt;
*text. A generic block of text &lt;br /&gt;
*image. An image &lt;br /&gt;
*northarrow. Renders a true north arrow for a particular map block. &lt;br /&gt;
*map. &amp;amp;nbsp;The map block draws a mapserver map as a raster, automatically scaling the map to higher resolution as required and embedding it as an image in the PDF. &amp;amp;nbsp;The map block includes the ability to specify a grid surrounding the map based on a GRID layer in the map. &amp;amp;nbsp;We extract the pixel coordinates of the intersection of the grid lines on the map with the edge of the map, do some funky math to figure out PDF coordinates based on the position of the map in the PDF and then add a neatline, grid tick marks and values outside the map itself using PDF objects &lt;br /&gt;
*legend. &amp;amp;nbsp;Renders a legend for a particular map block. &amp;amp;nbsp;We generate the legend in PDF objects rather than relying on MapServer's legend &lt;br /&gt;
*scalebar. &amp;amp;nbsp;Renders a scalebar using PDF objects&lt;/div&gt;</summary>
		<author><name>Wiki-Pagameba</name></author>
	</entry>
</feed>