OS4X plugin os4xplugin transmission pdf
Summary
The plugin "os4xplugin_transmission_pdf" dynamically creates a PDF file containing information about an OS4X job (like sender, recipient, meta information and files). It optionally sends this PDF file as an email to the corresponding person (see below for details).
After successful execution of this plugin, the created PDF will be saved in
- the job's directory (if the filemove plugin has been execution prior to this plugin execution)
- in the configured outgoing directory
If the saved PDF file is readable, the button "Print" is being enabled in OS4X Webaccess of this job.
"Corresponding person"
In this documentation, a "corresponding person" is often noted. This person is:
- outgoing jobs: the sender
- incoming jobs: the recipient
of the OS4X job. All data extracted person are being used.
Configuration
This plugin is highly configurable. There are mainly two topics covered which are configurable:
- layout (text and graphics)
- behaviour
Layout configuration
You can configure the following entities of the created PDF:
- The logo (PNG and JPEG files are supported). Beware of big logo images, even if the compressed PNG or JPEG file is small. PDF saves the content not that good compressed (but compressed anyway). Verify if a smaller filesize is better for you. The logo will be added on each page, so PDF filesize will be multiplied by the amount of pages by the size of this image.
- Header lines. If not configured (or configured to an empty string), the values are calculated dynamically by the person's data (line 1:company name, line2: location information, line 3: person's telephone and/or fax number).
- Page title text.
- Language for all labels ("de" for german, "en" for english" version supported)
- An optional footer text, two lines max.
In any textual situation, it's your responsability to check if the text fits into the line.
Behaviour configuration
- Use initial state instead of actual state: Filenames will be extracted from the initial XML of the job. This has advantages of you're using plugins such as TAR or ZIP creation plugins which use technical temporary filenames. File sizes and contents will be first checked at the position of the original state, as a fallback in the configured job directory (set by the filemove plugin).
- Render unknown filesizes: If no filesize is retrievable, a text block will be added stating that the size is not known.
- Analyze archive files: Known archive files (which are ZIP, TAR and gzip'ed TAR archives) will be scanned for the contained filenames and sizes. The content of these archives are also listed in the PDF per file. The mechanism is non-recursive.
- Disable mail sending: If enabled, no mail will be sent to the corresponding person.
- Debug mail execution: Mail sending might not work if not configured properly, so all commands which are used for mail transmission are logged in the plugin logs.
Mail templating
Several configurations about the mail behaviour are available. These are divided into:
Mail sender
The sender of the mail (passed to the MTA) is configurable. The default value is: "OS4X <os4x>
". The configurative value can include XPath expressions, indicated by a single dollar sign ("$
").
A productive example could be:
$/OS4X_job/job_information/sender/name $/OS4X_job/job_information/sender/surname <$/OS4X_job/job_information/sender/email_address>
Mail subject
The subject of the mail (passed to the MTA) is configurable. The default value is:
- english language: OS4X transmission PDF
- german language: OS4X Transfer-PDF
The configurative value can include XPath expressions, indicated by a single dollar sign ("$
").
A productive example could be:
OS4X Transfer-PDF - Auftrag $/OS4X_job/job_information/job_number (gesendet an Fa. $/OS4X_job/job_information/recipient/partner_longname)
Mail content
A configurable mail template must be configured. This text file is the body of the mail sent to the corresponding person. The default mail template is as follows:
Sehr geehrter OS4X-Nutzer, Ihr OS4X-Auftrag $/OS4X_job/job_information/job_number wurde erfolgreich transferiert. Anbei der zugehoerige Lieferschein. MfG OS4X
As you can see, a variable is contained in this template. You can use as many variables as you want, the plugin will replace them with the content of the variables. All variables are indicated by a dollar sign "$
" (as in shell scripts). The end of the variable name is a whitespace, tab or end of text. The variable itself is an XPath expression, i.e.:
/OS4X_job/job_information/job_number
This XPath information is executed on the configured XML (either actual or initial one, see above).