QGIS print composer templates - cccs-web/soc-maps GitHub Wiki

ACKNOWLEDGEMENT. Most of the content of this page derives from the official QGIS 1.8 Documentation—specifically from the 'Print Composer'. QGIS 1.8 content is licensed under Creative Commons Attribution-ShareAlike 3.0 licence (CC BY-SA). CCCS adapted the content to suit our purposes. Please see the full list of references at the end of this article. We are not affiliated with QGIS, nor with any of the sites linked herein.


QGIS Templates

A lot goes into printing a map. This page addresses ways to save time during map creation through the use of templates.

Print Composer Template

The print composer provides growing layout and printing capabilities [Table 1]. It allows you to add elements such as the QGIS map canvas, legend, scalebar, images, basic shapes, arrows and text labels. You can size, group, align and position each element and adjust the properties to create your layout.

Opening the print composer provides you with a blank canvas to which you can add the current QGIS map canvas, legend, scalebar, images, basic shapes, arrows and text.

[Note: QGIS is now able to show labels from the new labeling plugin also in the map composer, but it is not yet scaled correctly. So it might be necessary to switch back to the standard labeling in some cases.]

All Print Composer tools are available in menus and as icons in a toolbar. The toolbar can be switched off and on using the right mouse button holding the mouse over the toolbar.

Icon Purpose Icon Purpose
       
mActionFolder Load from template mActionFileSaveAs Save as template
mActionSaveMapAsImage Export to an image format mActionSaveAsPDF Export as PDF
mActionSaveAsSVG Export print composition to SVG mActionFilePrint Print or export as Postscript
mActionZoomFullExtent Zoom to full extent mActionZoomIn Zoom in
mActionZoomOut Zoom out mActionDraw Refresh view
mActionUndo Revert last change mActionRedo Restore last change
mActionAddMap Add new map from QGIS map canvas mActionAddImage Add image to print composition
mActionLabel Add label to print composition mActionAddLegend Add new legend to print composition
mActionScaleBar Add new scalebar to print composition mActionAddBasicShape Add basic shape to print composition
mActionAddArrow Add arrow to print composition mActionOpenTable Add attribute table to print composition
mActionSelectPan Select/Move item in print composition mActionMoveItemContent Move content within an item
mActionGroupItems Group items of print composition mActionUnGroupItems Ungroup items of print composition
mActionRaiseItems Raise selected items mActionLowerItems Lower selected items
mActionMoveItemsToTop Move selected items to top mActionMoveItemsToBottom Move selected items to bottom
mActionAlignLeft Align selected items left mActionAlignRight Align selected items right
mActionAlignHCenter Align selected items center mActionAlignVCenter Align selected items center vertical
mActionAlignTop Align selected items top mActionAlignBottom Align selected items bottom

The layout can be printed or exported to image formats, Postscript, PDF or to SVG. [Note: export to SVG is not working properly with some recent Qt4 versions. You should try and check individual on your system.]

You can save the layout as template and load it again in another session.

QGIS includes an option to save a Print Composer layout as a template that can be opened by any QGIS project.

e.g.

** QGIS_MapComposer_Template_simple.qpt

** basic-template_A3-landscape-1200-col1.qpt

Before you start to work with the print composer, [UNLESS YOU ARE WORKING ON TEMPLATE FORMATTING AND DON'T NEED TO SEE ANYTHING]

you need to load some raster and vector layers in the QGIS map canvas and to adapt their properties / symbolized to suite your needes.

In the printcomposer you can save a template. File>Save as template. And to use the template File>Load template.

After everything is rendered to your liking you click

File ‣ Action New Composer New Print Composer

choose

New Print Composer.

Open a new Print Composer Template

Project Templates

Thanks to Etienne Tourigny QGIS can load projects as a template.

This one could be quite handy for people that make a lot of maps with the same base data.

This means you can create a project with all your base layers, styles, labels, etc, configured and then load it by default, or from the file menu, and you will have everything setup.

All you have to do is save the a normal .qgs project file in

~/.qgis/project_templates folder and the project will be shown in the file menu.

Existing .qgs templates through the Project -> New from Template menu entry.

To save a project as a template:

The default folder is inside your profile folder (.qgis2).

To use existing qgis project files as templates (extension .qgs) just copy them inside the specified project templates folder. Then restart QGIS.

To open a project template:

  • menu > "New from Template"

  • QGIS 2.0 there is a category in the General tab where you can specify your template folder on your hardrive

Alt Text

You can also set the current project as the default template:

Handy!

References

⚠️ **GitHub.com Fallback** ⚠️