Abstract
This document defines the EPD (Emilda Print Data) version 1.0 standard, also known as application/emilda-print-data.
Description
Emilda is an integrated library system with a web-interface for all administrative functions. As such, Emilda works on any system with a standards compliant browser. For a functioning library Emilda requires a set of extra gadgets at the terminal, such as a label, receipt and normal printer. When a certain page is reached in the browser and the system decides that a print operation is to take place, the page in question contains a meta refresh tag which redirects the browser to a new page which provides an application/emilda-print-data document. This EPD document is to be opened using an external application which takes care of the printing process and user feedback. This document defines the EPD (application/emilda-print-data) format and usage.
Implementation
The EPD is a very simple format. It provides information to the application about what kind of document is to be printed so that the application can decide on what printer to use, it can contain a set of options where i.e. the orientation can be set to landscape or portrait, and the actual data which can be a binary postscript data or depending on the type of document a set of strings containing i.e. barcode numbers and IDs. The application which prints the data will have to transform the data provided to a format that the printer will understand. This document only defines the EPD format and all printing related problems are beyond the scope of this document. The EPD syntax must be followed to the bit and is the following (<LF> means the newline character, US-ASCII 10):
TYPE<LF>
OPTIONS<LF><LF>
DATA
The first line tells us that we have a version 1.0 EPD document. Every application that expects an EPD document should check this line and verify that the version is correct. If the version is lower then backwards compatible mode can be turned on if possible. Higher version numbers can be dealt with, if and only if the minor number has been changed but the major is the same. An increase in the major (in this case 1) means that the format is not backwards compatible. An increase in the minor (in this case 0) means that the format has new features that are independed from the old ones and are not required in a valid EPD document.
- postscript
- label
- receipt
- Postscript Data
If the TYPE is postscript the DATA should be pure Postscript in a format that can be directly sent to a Postscript compatible printer. - Label Data
If the TYPE is label the DATA should contain a "heading" text, newline, and a barcode in normal ASCII. If there is more than one label to be printed the barcodes should be entered after the first one, separated by newlines. The last barcode must always end in a newline, even if there is only one. - Receipt Data
If the TYPE is receipt the DATA should contain the text to be printed on a receipt in normal ASCII format. Newlines are treated as newlines on the receipt. The first line should contain a header text. If no header is wanted, a blank line must exist. The tag <HEADER> will be replaced in the DATA with a properly formatted text (the first line) using printer specific language.
Type
The TYPE line defines what kind of data DATA is. Based on this, the application can decide what printers to use and how to transform the data into a real printer format. Valid values are:
Options
The OPTIONS line can contain a set of options for the TYPE. The option list has the following syntax:
No whitespaces are allowed (option names and values may contain them though) and the ; separator must only be used between options, not before the first one nor after the last one.
Data
The DATA part contains the raw data. When parsing an EPD document, the two newlines before the DATA are significant as they tell the parser where the data begins. Future versions of the EPD may contain more features and are added after OPTIONS. A valid parser should ignore anything it doesn't know and search for the double newline, after which the DATA begins. This is very important as backwards compatible 1.x versions may include new rows after OPTIONS.

