Using MapFish Print v3

Template configuration

All print-related files are located in the print/ folder, and the files related to the template in the print/print-apps/<package> folder.

The main configuration file is print/print-apps/<package>/config.yaml.

Notes about the scales

The web map and the map printing do not use the same scales. Therefore, if you change the configuration of min/max scaling, you should also test map printing to be sure that it also works as expected.

Using a single print server in a set of sites

For memory issues, it is recommended to only use a single print server for a set of sites.

For that, we need to have only one vars_<project>.yaml which can easily be generated by the templating. Then we should do:

  • Remove the print from the children projects by removing the print folder:

    git rm print
  • Deactivate the print compilation by adding the following lines in the <package>.mk file:

  • Point to the parent print server by editing the following lines in the vars.yaml file:

        # For print proxy
        # This value means that we use the parent print server
        print_url: http://{host}:8080/print/pdf/
  • If needed, set the print templates used by anonymous users by adding the following in the application configuration (vars.yaml):

              - 1 A4 child
              - 2 A3 child

Having a dedicated print instance

The goal is to be able to create a custom makefile with which one we make:

make --makefile=<file>.mk

to build only the print service.

For this, create a makefile with:

BUILD_RULES = test-packages print
TEST_PACKAGES = main print