Print composer

提供: OSGeo.JP Wiki
2009年10月5日 (月) 01:02時点におけるSanak (トーク | 投稿記録)による版

移動: 案内検索

Print Composer

The print composer provides growing layout and printing capabilities. It allows you to add elements such as the QGIS map canvas, legend, scalebar, images, and text labels. You can size, group align and position each element and adjust the properties to create your layout. The layout can be printed (also to Postscript and PDF), exported to image formats or to SVG and you can save the layout as template and load it again in another session. See a list of tools in table <A HREF="#tab:printcomposer_tools">4</A>: <P>
<P>

Table 4: Print Composer Tools
Icon Purpose Icon Purpose
[width=0.7cm]mActionFolder Load from template [width=0.7cm]mActionFileSaveAs Save as template
[width=0.7cm]mActionExportMapServer Export to an image format [width=0.7cm]mActionSaveAsSVG Export print composition to SVG
[width=0.7cm]mActionFilePrint Print or export as PDF or Postscript [width=0.7cm]mActionZoomFullExtent Zoom to full extend
[width=0.7cm]mActionZoomIn Zoom in [width=0.7cm]mActionZoomOut Zoom out
[width=0.7cm]mActionDraw Refresh view [width=0.7cm]mActionAddRasterLayer Add new map from QGIS map canvas
[width=0.7cm]mActionSaveMapAsImage Add Image to print composition [width=0.7cm]mActionLabel Add label to print composition
[width=0.7cm]mActionAddLegend Add new legend to print composition [width=0.7cm]mActionScaleBar Add new scalebar to print composition
[width=0.7cm]mActionSelectPan Select/Move item in print composition [width=0.7cm]mActionMoveItemContent Move content within an item
[width=0.7cm]mActionGroupItems Group items of print composition [width=0.7cm]mActionUngroupItems Ungroup items of print composition
[width=0.7cm]mActionRaiseItems Raise selected items [width=0.7cm]mActionLowerItems Lower selected items
[width=0.7cm]mActionMoveItemsToTop Move selected items to top [width=0.7cm]mActionMoveItemsToBottom Move selected items to bottom
[width=0.7cm]mActionAlignLeft Align selected items left [width=0.7cm]mActionAlignRight Align selected items right
[width=0.7cm]mActionAlignHCenter Align selected items center [width=0.7cm]mActionAlignVCenter Align selected items center vertical
[width=0.7cm]mActionAlignTop Align selected items top [width=0.7cm]mActionAlignBottom Align selected items bottom


To access the print composer, click on the mActionFilePrintPrint button in the toolbar or choose File > mActionFilePrintPrint Composer. <P>


<A NAME="CHILD_LINKS">Subsections</A>

Using Print Composer

<P> Before you start to work with the print composer, you need to load some raster and vector layers in the QGIS map canvas and adapt their properties to suite your own convinience. After everything is rendered and symbolized to your liking you click the mActionFilePrintPrint Composer icon.

<P>

<A NAME="fig:print_composer_blank"></A><A NAME="57"></A>
Figure: Print Composer

[clip=true, width=]print_composer_blank

<P> Opening the print composer provides you with a blank canvas to which you can add the current QGIS map canvas, legend, scalebar, images and text. Figure <A HREF="#fig:print_composer_blank">37</A> shows the initial view of the print composer with an activated Snap to grid modus but before any elements are added. The print composer provides two tabs:

<P>

  • The General tab allows you to set paper size, orientation, the print quality for the output file in dpi and to activate snapping to a grid of a defined resolution. Please note, the Snap to grid feature only works, if you define a grid resolution > 0. Furthermore you can also activate the Print as raster checkbox. This means all elements will be rastered before printing or saving as Postscript of PDF.
  • The Item tab displays the properties for the selected map element. Click the mActionSelectPanSelect/Move item icon to select an element (e.g. legend, scalebar or label) on the canvas. Then click the Item tab and customize the settings for the selected element.

<P> You can add multiple elements to the composer. It is also possible to have more than one map view or legend or scalebar in the print composer canvas. Each element has its own properties and in the case of the map, its own extent.

<P>




Adding a current QGIS map canvas to the Print Composer

<P> To add the QGIS map canvas, click on the mActionAddRasterLayerAdd new map from QGIS map canvas button in the print composer toolbar and drag a rectangle on the composer canvas with the left mouse button to add the map. You will see an empty box with a "Map will be printed here" message. To display the current map, you can choose between three different modes in the map Item tab:

<P>

  • PreviewRectangle is the default setting. It only displays an empty box with a message "Map will be printed here".
  • PreviewCache renders the map in the current screen resolution. If case you zoom in or out the composer window, the map is not rendered again but the image will be scaled.
  • PreviewRender means, that if you zoom in or out the composer window, the map will be rendered again, but for space reasons, only up to a maximum resolution.

<P>

<A NAME="fig:print_composer_map_item"></A><A NAME="subfig:print_composer_map_item1"></A><A NAME="subfig:print_composer_map_item2"></A><A NAME="87"></A>
Figure: Print Composer map item tab content
[Width, height and extend dialog] [clip=true, width=0.4]print_composer_map_item1 [Properties dialog] [clip=true, width=0.4]print_composer_map_item2

<P> You can resize the map later by clicking on the mActionSelectPanSelect/Move item button, selecting the element, and dragging one of the blue handles in the corner of the map. With the map selected, you can now adapt more properties in the map Item tab. Resize the map item specifying the width and height or the scale. Define the map extend using Y and X min/max values or clicking the set to map canvas extend button. Update the map preview and select, whether to see a preview from cache or an empty rectangle with a "Map will be printed here" message. Define colors and outline width for the element frame, set a background color and opacity for the map canvas. And you can also select or unselect to display an element frame with the frame checkbox (see Figure <A HREF="#fig:print_composer_map_item">38</A>). If you change the view on the QGIS map canvas by zooming or panning or changing vector or raster properties, you can update the print composer view selecting the map element in the print composer and clicking the Update Preview button in the map Item tab (see Figure <A HREF="#fig:print_composer_map_item">38</A>).

<P> To move layers within the map element select the map element, click the mActionMoveItemContentMove item content icon and move the layers within the map element frame with the left mouse button.

<P>

<A NAME="CHILD_LINKS">Subsections</A>

Navigation tools

<P> For map navigation the print composer provides 4 general tools:

<P>

  • mActionZoomOutZoom in,
  • mActionZoomOutZoom out,
  • mActionZoomFullExtentZoom to full extend and
  • mActionDrawRefresh the view, if you find the view in an inconsistent state.

<P>

Adding other elements to the Print Composer

<P> Besides adding a current QGIS map canvas to the Print Composer, it is also possible to add, position, move and customize legend, scalebar, images and label elements.

<P> Label and images

<P> To add a label or an image, click the mActionLabelAdd label or mActionSaveMapAsImageAdd image icon, place the element with the left mouse button on the print composer canvas and position and customize their appearance in the Item tab.

<P>

<A NAME="fig:print_composer_tab2"></A><A NAME="subfig:print_composer_label_item"></A><A NAME="subfig:print_composer_image_item"></A><A NAME="125"></A>
Figure: Customize print composer label and images
[label item tab] [clip=true, width=0.4]print_composer_label_item [image item tab] [clip=true, width=0.4]print_composer_image_item

<P> Legend and scalebar

<P> To add a map legend or a scalebar, click the mActionAddLegendAdd new legend or mActionScaleBarAdd new scalebar icon, place the element with the left mouse button on the print composer canvas and position and customize their appearance in the Item tab.

<P>

<A NAME="fig:print_composer_tab1"></A><A NAME="subfig:print_composer_legend_item"></A><A NAME="subfig:print_composer_scalebar_item"></A><A NAME="139"></A>
Figure: Customize print composer legend and scalebar
[legend item tab] [clip=true, width=0.4]print_composer_legend_item [scalebar item tab] [clip=true, width=0.4]print_composer_scalebar_item

<P>

Raise, lower and align elements

<P> Raise or lower functionalities for elements are inside the mActionRaiseItemsRaise selected items pulldown menu. Choose an element on the print composer canvas and select the matching functionality to raise or lower the selected element compared to the other elements (see table <A HREF="node1.html#tab:printcomposer_tools">4</A>).

<P> There are several alignment functionalities available within the mActionAlignLeftAlign selected items pulldown menu (see table <A HREF="node1.html#tab:printcomposer_tools">4</A>). To use an alignment functionality , you first select some elements and then click on the matching alignment icon. All selected will then be aligned within to their common bounding box.

<P>

Creating Output

<P> Figure <A HREF="#fig:print_composer_complete">41</A> shows the print composer with an example print layout including each type of map element described in the sections above.

<P>

<A NAME="fig:print_composer_complete"></A><A NAME="157"></A>
Figure: Print Composer with map view, legend, scalebar, and text added

[clip=true, width=]print_composer_complete

<P> The print composer allows you to create several output formats and it is possible to define the resolution (print quality) and paper size:

<P>

  • The mActionFilePrintPrint icon allows to print the layout to a connected printer or as PDF or Postscript file depending on installed printer drivers.
  • The mActionExportMapServerExport as image icon exports the composer canvas in several image formats such as PNG, BPM, TIF, JPG, ...
  • The mActionSaveAsSVGExport as SVG icon saves the print composer canvas as a SVG (Scalable Vector Graphic). Note: Currently the SVG output is very basic. This is not a QGIS problem, but a problem of the underlaying Qt library. This will hopefully be sorted out in future versions.

Saving and loading a print composer layout

<P> With the mActionFileSaveAsSave as template and mActionFolderLoad from template icons you can save the current state of a print composer session as a *.qpt template and load the template

again in another session.