Options
All
  • Public
  • Public/Protected
  • All
Menu

A print job for a Cloud Office Print server. This class contains all configuration options, resources, render elements ... and the PrintJob.execute method to combine all these and send a request to the Cloud Office Print server.

Hierarchy

  • PrintJob

Index

Constructors

constructor

  • Parameters

    • data: Element | RESTSource | {}

      This is either: An Element (e.g. an ElementCollection); A mapping, containing file names as keys and an Element as data. Multiple files will be produced from the different datas, the result is a zip file containing them. In the first case, no output file name is specified and the server will name it "file0".

    • server: Server

      Server to be used for this print job.

    • Optional template: Resource

      Template to use for this print job.

    • outputConfig: OutputConfig = ...

      Output configuration to be used for this print job. Defaults to OutputConfig().

    • subtemplates: {} = {}

      Subtemplates for this print job, accessible (in docx) through {?include subtemplate_dict_key}. Defaults to {}.

    • prependFiles: Resource[] = []

      Files to prepend to the output file. Defaults to [].

    • appendFiles: Resource[] = []

      Files to append to the output file. Defaults to [].

    • copVerbose: boolean = false

      Whether or not verbose mode should be activated. Defaults to False.

    Returns PrintJob

Properties

appendFiles

appendFiles: Resource[]

copVerbose

copVerbose: boolean

data

data: Element | RESTSource | {}

outputConfig

outputConfig: OutputConfig

prependFiles

prependFiles: Resource[]

server

server: Server

subtemplates

subtemplates: {}

Type declaration

template

template: undefined | Resource

Methods

asDict

  • asDict(): {}
  • The dict representation of this object

    Returns {}

    dict representation of this object

    • [key: string]: unknown

execute

Static executeFullJson

  • executeFullJson(jsonData: object, server: Server): Promise<Response>
  • If you already have the JSON to be sent to the server (not just the data, but the entire JSON body including your API key and template), this package will wrap the request to the server.

    Parameters

    • jsonData: object

      full JSON data that needs to be sent to a Cloud Office Print server

    • server: Server

      Server-object

    Returns Promise<Response>

    Response-object

Static handleResponse

  • handleResponse(res: Response): Promise<Response>
  • Converts the HTML response to a Response-object

    throws

    COPError when response status is not OK

    Parameters

    • res: Response

      HTML response from the Cloud Office Print server

    Returns Promise<Response>

    Response-object of HTML response

Generated using TypeDoc