Print

The action of printing a document.

There are various events associated with printing due to the queued nature of print jobs. These events are generated by both operating systems and printers and have enumerated values for the <Action> element as follows:

  • Operating System:
    • CreateJob – When a user chooses to print a document.
    • CancelJob – When a user chooses to cancel a print job in the print queue.
  • Printer:
    • StartPrint – When the printer begins printing.
    • FinishPrint – When the printer finishes printing.
    • CancelPrint – When the printing is cancelled from the printer.

The description of the event shall be contained within the structure shown in the following example.

<EventDetail>
  <TypeId>PrintDocument</TypeId>
  <Print>
    <Action>CreateJob</Action>
    <PrintJob>
      <Document>
        <Title>Some document</Title>
      </Document>
      <Pages>40</Pages>
      <Size>644236</Size>
    </PrintJob>
    <PrintSettings>
      <PaperSize>A4</PaperSize>
      <Orientation>Portrait</Orientation>
      <Colour>true</Colour>
      <DeviceFonts>false</DeviceFonts>
    </PrintSettings>
    <Printer>
      <Id>printer796</Id>
      <Name>LaserJet4+</Name>
      <IPAddress>192.168.2.52</IPAddress>
      <Room>A34-2</Room>
    </Printer>
  </Print>
</EventDetail>

For all print actions the <PrintJob> element describes what is being printed. Details about the document related to the print job may be described within the <Document> element.

For print events the <Size> element contains the spooled size of the document being printed in bytes and not the original file size on disk.

The printer being used can be described using the <Printer> element when it is known which printer will be printing the document.

The IP address or host name of the printer will either be:

  • The IP/host of the printer itself if it is a network printer.
  • The IP/host of the computer that the printer is attached to if it is not a network printer.   If a print job fails the reason for failure can be included in the <Outcome> element, see the following example.
<EventDetail>
  <TypeId>PrintDocument</TypeId>
  <Print>
    <Action>StartPrint</Action>
    <PrintJob>
      <Document>
        <Title>Some document</Title>
      </Document>
      <Pages>40</Pages>
      <Size>644236</Size>
    </PrintJob>
    <PrintSettings>
      <PaperSize>A4</PaperSize>
      <Orientation>Portrait</Orientation>
      <Colour>true</Colour>
      <DeviceFonts>false</DeviceFonts>
    </PrintSettings>
    <Printer>
      <HostName>someprinter.someorg.org</HostName>
    </Printer>
    <Outcome>
      <Success>false</Success>
      <Description>The printer is out of paper.</Description>
    </Outcome>
  </Print>
</EventDetail>
Last modified November 29, 2023: Update oxygen_schema_docs.md (85e195a)