M.4. IPP Routing Plug-in

This plug-in is called on an IPP Routing event, just before the PDF is send to the Proxy Printer.

The plug-in supports PDF edit actions, like adding header and footer text, and a QR code image. The QR code itself can optionally be a constant, a generated UUID or obtained by executing a third-party RESTful POST request that registers the print job and delivers the QR code in return.

Note

The QR code is shown in the Documents and Transactions Log.

Tip

If the Document Store is enabled for Print Out, and Archive/Journal is not disabled for the target Proxy Printer, a third-party can retrieve the printed PDF by calling a SavaPage RESTful service with the QR code as ext_id. See Section C.2.3.2.6, “GET /documents/ext_id=<ext_id>/pdf”.

An annotated savapage-ext-ipp-routing.properties.template is present in the /opt/savapage/ext directory. Copy this template to a file with a .properties extension in the same directory and restrict permissions, since the file contains confidential information. An example:

$ sudo su - savapage
$ cd /opt/savapage/server/ext
$ cp savapage-ext-ipp-routing.properties.template savapage-ext-ipp-routing.properties
$ chmod 600 savapage-ext-ipp-routing.properties

Edit the .properties file to specify the necessary data and restart SavaPage to test the plug-in.

Apart from the standard plug-in keys, the plug-in file contains specific routing.* keys as explained in the table below.

KeyDescription

routing.id

A fixed or generated routing ID stored as document ext_id (max 64 chars). See Section C.2.3.2.4, “GET /documents/ext_id=<ext_id>”

Placeholder values:

  • $uuid$ : Generated UUID.

RESTful POST request to register print job and obtain QR code.

routing.rest.uri

RESTful resource URI.

routing.rest.user

routing.rest.password

HTTP Basic Authentication User and Password.

routing.rest.post.request.entity

The entity to be POST-ed.

Placeholder values:

  • $uuid$ : Generated UUID.

  • $user_id$ : User id

  • $client_ip$ : Client IP address

  • $queue_name$ : Print-in Queue name

  • $printer_name$ : CUPS printer name

  • $printer_uri$ : CUPS printer URI

  • $printer_uri_host$ : CUPS printer URI host component

  • $job_name$ : Print Job Name (document name)

  • $job_time$ : Print Job datetime in ISO_8601 format

  • $page_width_mm$ : Print Job first page width (millimeters).

  • $page_height_mm$ : Print Job first page height (millimeters).

routing.rest.post.request.mediatype

Media type of request entity. There are tywo options:

  • text/plain

  • application/json

routing.rest.post.response.mediatype

Media type of request entity. There are two options:

  • text/plain : delivers the QR code as plain text.

  • application/json : delivers the JSON representaton of org.savapage.ext.print.IppRoutingDto POJO[a]. The routing "id" is mandatory. All other values override the ones that are configured in their respective routing.pdf.* keys of the .properties file (see keys below).

QR image

routing.pdf.qrcode.content

QR code content.

Placeholder values:

  • $routing_id$ : routing.id

routing.pdf.qrcode.size

Square QR code size in millimeters (width == height).

routing.pdf.qrcode.qz

Quiet zone [b] in millimeters. When not specified, zero (0) is applied.

routing.pdf.qrcode.pos.anchor

Position in PDF document. TL (top-left, default), TR (top-right), BL (bottom-left), BR (bottom-right).

routing.pdf.qrcode.pos.margin.x

routing.pdf.qrcode.pos.margin.y

Margins in millimeters.

Header

routing.pdf.header.text

Header text: Helvetica Font, color Gray.

routing.pdf.header.font.size

Font size points (pt).

routing.pdf.header.margin.top

Top margin in millimeters.

Footer

routing.pdf.footer.text

Footer text: Helvetica Font, color Gray.

routing.pdf.footer.font.size

Font size points (pt).

routing.pdf.footer.margin.bottom

Bottom margin in millimeters.

PDF info (optional)

routing.pdf.info.title

PDF Title

routing.pdf.info.subject

PDF Subject

routing.pdf.info.author

PDF Author

routing.pdf.info.keywords

A space separated list of PDF keywords.

[a] org.savapage.ext.print.IppRoutingDto POJO can be found in https://gitlab.com/savapage/savapage-ext.

[b] The Quiet Zone (QZ) is the area around the QR code that is clear of text, graphics, and any other printing. The QZ helps isolate a QR code of its surroundings in order to guarantee a correct readability.

Table M.3. IPP Routing Plug-in: .properties keys


Some examples:

Note

Multiple IPP Routing Plug-ins can be active in /opt/savapage/ext directory. Each one will be executed upon an IPP Routing event. The order of execution is undefined.