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 RESTfull 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 RESTfull service with the QR code as ext_id. See Section C.2.3.1.7, “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

ID stored as document ext_id (max 64 chars). See Section C.2.3.1.5, “GET /documents/ext_id=<ext_id>”

Placeholder values:

  • $pdf.qrcode$ : QR code used in PDF.

routing.pdf.qrcode

A fixed or generated QR code.

Placeholder values:

  • $uuid$ : Generated UUID.

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

routing.pdf.qrcode.rest.uri

RESTfull resource URI.

routing.pdf.qrcode.rest.user

routing.pdf.qrcode.rest.password

HTTP Basic Authentication User and Password.

routing.pdf.qrcode.rest.post.request.entity

The entity to be POST-ed.

Placeholder values:

  • $uuid$ : Generated UUID.

  • $user_id$ : User id

  • $client_ip$ : Client IP address

  • $printer_name$ : CUPS printer name

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

  • $job_time$ : Print Job datetime in ISO_8601 format

routing.pdf.qrcode.rest.post.request.mediatype

Media type of request entity. For example:

  • text/plain

  • application/json

routing.pdf.qrcode.rest.post.response.mediatype

Media type of the QR code. For now, text/plain is the only value supported, meaning the QR code must be delivered as plain text.

QR code image

routing.pdf.qrcode.size

Square QR code size in pixels.

routing.pdf.qrcode.qz

Quiet zone [a] in pixels. When not specified, a default is applied.

routing.pdf.qrcode.pos

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 PDF points: 1 inch == 72 points.

Header

routing.pdf.header

Header text: Helvetica Font, color Gray.

routing.pdf.header.font.size

Font size points (pt).

routing.pdf.header.margin.top

Top margin in PDF points: 1 inch == 72 points.

Footer

routing.pdf.footer

Footer text: Helvetica Font, color Gray.

routing.pdf.footer.font.size

Font size points (pt).

routing.pdf.footer.margin.bottom

Bottom margin in PDF points: 1 inch == 72 points.

[a] 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.