Filter menu: definition of filters and processes
Author: Dr. Frank Hoffmann, 2003/11/10
Since ZMS 2.1 a new configuration interface for free definable transformators ('filters') is available; a filter consists of a string of single steps ("processes') which take over the control of the external converter application.
The following example shows the ZMS filter concept by means of a filter for the export of a ZMS publication as OpenOffice-document.
Since ZMS 2.1 a menu entry "filter" exists in the ZMS configuration. Here two element types can be configured:
To write e.g. an OpenOffice-filter you proceed as follows:
A filter consists of a sequence of 'processes'; to each 'process' a configuration file resp. transformation file (e.g. XSL-file) is handed over.
Exemplary content flow with interspersed "processing instruction" elements which prepare special section in the target format already in ZMS (e.g. layout variation in the addment, position of table of contents etc.)
For an experienced export it is recommended to regard further details:
if the exported OO-document is finally set fine after the export and the make-up is polished by the image sizes, the invested work should not be in vain with the follow-up export (of a new edition). For this an XSL method can be developed, with which the export can extract the OO-specific image parameter from the last OO-typesetting, meaning: the export "learns from the old edition".
A reverse transformation is to be implemented in an analogical way. Of course, precondition is in both cases the strict correspondence of all format elements. In case of such transformations the DTD conformity pays off: it is clear that non-defined (in-line) elements resp. non-XHTML artifacts more or less can constrain the transformation.
The command line tool 'HTMLDOC' allows a relative simple but in most cases sufficient conversion of HTML streams to PDF format. The related filter needs two steps only:
Tidy configuration: the UTF-8-Codes from ZMS must be changed to Latin-1 to be correctly transformed by HTMLdoc.
add-xml-decl: no doctype: omit enclose-block-text: yes enclose-text: yes input-encoding: utf8 char-encoding: utf8 output-encoding: latin1 drop-font-tags: yes numeric-entities: yes
Installation: HTMLdoc and Tidy must be installed on the system resp. their paths must be known. The XML configuration file below is imported into the configuration menu "filter". The programme paths are adapted in both batch steps "htmldoc" and "tidy".
IMPORTANT NOTE: The paths for the programme calls (e.g. C:\Programme\HTMLDOC\) used in both batch steps must be adapted to the local situation so that the programme call of the ZMS filter will work.
With Linux both process steps might look e.g:
htmldoc --book --toctitle "Table of Contents" --header t.l
--size A4 -t pdf13 -f {out.pdf} {in}
tidy -asxml -config {trans} -m {in}
Resources
HTMLdocFilter.xml (2KB)
HTMLdocFilter.xml (2KB)