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.
The QR code is shown in the Documents and Transactions Log.
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.
Key | Description |
---|---|
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:
|
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:
|
routing.rest.post.request.mediatype |
Media type of request entity. There are tywo options:
|
routing.rest.post.response.mediatype |
Media type of request entity. There are two options:
|
QR image | |
routing.pdf.qrcode.content |
QR code content. Placeholder values:
|
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. |
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]
[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:
A plug-in using SavaPage RESTful service to echo the generated
routing.pdf.qrcode.content
. This has no practical
use other than to test the RESTful
interface.
routing.id=$uuid$ routing.pdf.qrcode.rest.uri=https://localhost:8632/restful/v1/tests/echo routing.pdf.qrcode.rest.user=admin routing.pdf.qrcode.rest.password=password routing.pdf.qrcode.rest.post.request.entity=$uuid$ routing.pdf.qrcode.rest.post.request.mediatype=text/plain routing.pdf.qrcode.rest.post.response.mediatype=text/plain routing.pdf.qrcode.size=12 routing.pdf.qrcode.qz=2 routing.pdf.qrcode.pos=BR routing.pdf.qrcode.pos.margin.x=9 routing.pdf.qrcode.pos.margin.y=35 routing.pdf.header=Sample Header Text routing.pdf.header.font.size=8 routing.pdf.header.margin.top=15 routing.pdf.footer=Sample Footer Text routing.pdf.footer.font.size=6 routing.pdf.foooter.margin.bottom=10
A plug-in calling a third-party RESTful service to obtain the
routing.pdf.qrcode.content
. See RESTful
Client configuration
properties.
routing.id=$uuid$ routing.pdf.qrcode.rest.uri=https://192.168.1.51:8080/register routing.pdf.qrcode.rest.user=savapage routing.pdf.qrcode.rest.password=elah7deV routing.pdf.qrcode.rest.post.request.entity={"printUser":"$user_id$",\ "printIp":"$client_ip$",\ "printerName":"$printer_name$",\ "docTitle":"$job_name$",\ "printTime":"$job_time$"} routing.pdf.qrcode.rest.post.request.mediatype=application/json routing.pdf.qrcode.rest.post.response.mediatype=text/plain routing.pdf.qrcode.size=12 routing.pdf.qrcode.qz=2 routing.pdf.qrcode.pos=BR routing.pdf.qrcode.pos.margin.x=9 routing.pdf.qrcode.pos.margin.y=35
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.