# Class PrintService

#### Hierarchy

- PrintService

- Defined in src/print/Service.js:83

#####
Index

### Properties

$http_
gettextCatalog_
goodnessOfFit_
ngeoLayerHelper_
printNativeAngle_
url_
vectorEncoder

### Methods

cancel
createReport
createSpec
encodeImageLayer_
encodeImageWmsLayer_
encodeLayer
encodeMap_
encodeTileLayer_
encodeTileWmsLayer_
encodeTileWmtsLayer_
encodeVectorLayer
encodeWmsLayer_
getCapabilities
getOpacityOrInherited_
getReportUrl
getStatus
getWmtsUrl_

## Properties

### $http_

$http_: IHttpService

- Defined in src/print/Service.js:92

### gettextCatalog_

gettextCatalog_: gettextCatalog

- Defined in src/print/Service.js:97

### goodnessOfFit_

goodnessOfFit_: number

- Defined in src/print/Service.js:117
- Defined in src/print/Service.js:166

### ngeoLayerHelper_

ngeoLayerHelper_: LayerHelper

- Defined in src/print/Service.js:102

### printNativeAngle_

printNativeAngle_: boolean

- Defined in src/print/Service.js:112
- Defined in src/print/Service.js:226

### url_

url_: string

- Defined in src/print/Service.js:87

### vectorEncoder

vectorEncoder: default

- Defined in src/print/Service.js:107

## Methods

### cancel

- cancel(ref: string, opt_httpConfig?: IRequestShortcutConfig): IHttpPromise<Object>

- Cancel a report.

  ### Returns

  HTTP promise.

  #### Parameters

  - ##### ref: string

    Print report reference.

  - ##### `Optional` opt_httpConfig: IRequestShortcutConfig

    $http config object.

  #### Returns IHttpPromise<Object>

  - Defined in src/print/Service.js:127

### createReport

- createReport(printSpec: MapFishPrintSpec, opt_httpConfig?: IRequestShortcutConfig): IHttpPromise<MapFishPrintReportResponse>

- Send a create report request to the MapFish Print service.

  ### Returns

  HTTP promise.

  #### Parameters

  - ##### printSpec: MapFishPrintSpec

    Print specification.

  - ##### `Optional` opt_httpConfig: IRequestShortcutConfig

    $http config object.

  #### Returns IHttpPromise<MapFishPrintReportResponse>

  - Defined in src/print/Service.js:513

### createSpec

- createSpec(map: Map, scale: number, rotation: number, dpi: number, layout: string, format: string, customAttributes: Object, email?: string, goodnessOfFit?: number): MapFishPrintSpec

- Create a report specification.

  ### Returns

  The print spec.

  #### Parameters

  - ##### map: Map

    Map.

  - ##### scale: number

    Scale.

  - ##### rotation: number

    Rotation.

  - ##### dpi: number

    DPI.

  - ##### layout: string

    Layout.

  - ##### format: string

    Formats.

  - ##### customAttributes: Object

    Custom attributes.

  - ##### `Optional` email: string

    Email to send the file to.

  - ##### `Optional` goodnessOfFit: number

    Goodness of fit.

  #### Returns MapFishPrintSpec

  - Defined in src/print/Service.js:149

### encodeImageLayer_

- encodeImageLayer_(arr: MapFishPrintLayer[], layer: ImageLayer<ImageSource>): void

- #### Parameters

  - ##### arr: MapFishPrintLayer[]

    Array.

  - ##### layer: ImageLayer<ImageSource>

    Layer.

  #### Returns void

  - Defined in src/print/Service.js:270

### encodeImageWmsLayer_

- encodeImageWmsLayer_(arr: MapFishPrintLayer[], layer: ImageLayer<ImageSource>): void

- #### Parameters

  - ##### arr: MapFishPrintLayer[]

    Array.

  - ##### layer: ImageLayer<ImageSource>

    Layer.

  #### Returns void

  - Defined in src/print/Service.js:284

### encodeLayer

- encodeLayer(arr: MapFishPrintLayer[], layer: BaseLayer, resolution: number, destinationPrintDpi: number): void

- #### Parameters

  - ##### arr: MapFishPrintLayer[]

    Array.

  - ##### layer: BaseLayer

    Layer.

  - ##### resolution: number

    Resolution.

  - ##### destinationPrintDpi: number

    The destination print DPI.

  #### Returns void

  - Defined in src/print/Service.js:246

### encodeMap_

- encodeMap_(map: Map, scale: number, object: MapFishPrintMap, destinationPrintDpi: number): void

- #### Parameters

  - ##### map: Map

    Map.

  - ##### scale: number

    Scale.

  - ##### object: MapFishPrintMap

    Object.

  - ##### destinationPrintDpi: number

    The destination print DPI.

  #### Returns void

  - Defined in src/print/Service.js:200

### encodeTileLayer_

- encodeTileLayer_(arr: MapFishPrintLayer[], layer: any): void

- #### Parameters

  - ##### arr: MapFishPrintLayer[]

    Array.

  - ##### layer: any

    Layer.

  #### Returns void

  - Defined in src/print/Service.js:383

### encodeTileWmsLayer_

- encodeTileWmsLayer_(arr: MapFishPrintLayer[], layer: any): void

- #### Parameters

  - ##### arr: MapFishPrintLayer[]

    Array.

  - ##### layer: any

    Layer.

  #### Returns void

  - Defined in src/print/Service.js:463

### encodeTileWmtsLayer_

- encodeTileWmtsLayer_(arr: MapFishPrintLayer[], layer: any): void

- #### Parameters

  - ##### arr: MapFishPrintLayer[]

    Array.

  - ##### layer: any

    Layer.

  #### Returns void

  - Defined in src/print/Service.js:399

### encodeVectorLayer

- encodeVectorLayer(arr: MapFishPrintLayer[], layer: VectorLayer<VectorSource<Geometry>>, resolution: number, destinationPrintDpi: number): void

- #### Parameters

  - ##### arr: MapFishPrintLayer[]

    Array.

  - ##### layer: VectorLayer<VectorSource<Geometry>>

    Layer.

  - ##### resolution: number

    Resolution.

  - ##### destinationPrintDpi: number

    The destination print DPI.

  #### Returns void

  - Defined in src/print/Service.js:262

### encodeWmsLayer_

- encodeWmsLayer_(arr: MapFishPrintLayer[], layer: any, url: string, params: Object): void

- #### Parameters

  - ##### arr: MapFishPrintLayer[]

    Array.

  - ##### layer: any

    The layer.

  - ##### url: string

    URL of the WMS server.

  - ##### params: Object

    URL parameters

  #### Returns void

  - Defined in src/print/Service.js:305

### getCapabilities

- getCapabilities(opt_httpConfig?: IRequestShortcutConfig): IHttpPromise<MapFishPrintCapabilities>

- Get the print capabilities from MapFish Print.

  ### Returns

  HTTP promise.

  #### Parameters

  - ##### `Optional` opt_httpConfig: IRequestShortcutConfig

    $http config object.

  #### Returns IHttpPromise<MapFishPrintCapabilities>

  - Defined in src/print/Service.js:555

### getOpacityOrInherited_

- getOpacityOrInherited_(layer: BaseLayer): number

- Return an opacity value for the specified layer.

  ### Returns

  opacity Opacity value.

  #### Parameters

  - ##### layer: BaseLayer

    Layer.

  #### Returns number

  - Defined in src/print/Service.js:499

### getReportUrl

- getReportUrl(ref: string): string

- Get the URL of a report.

  ### Returns

  The report URL for this ref.

  #### Parameters

  - ##### ref: string

    Print report reference.

  #### Returns string

  - Defined in src/print/Service.js:545

### getStatus

- getStatus(ref: string, opt_httpConfig?: IRequestShortcutConfig): IHttpPromise<MapFishPrintStatusResponse>

- Get the status of a report.

  ### Returns

  HTTP promise.

  #### Parameters

  - ##### ref: string

    Print report reference.

  - ##### `Optional` opt_httpConfig: IRequestShortcutConfig

    $http config object.

  #### Returns IHttpPromise<MapFishPrintStatusResponse>

  - Defined in src/print/Service.js:532

### getWmtsUrl_

- getWmtsUrl_(source: WMTS): string

- Return the WMTS URL to use in the print spec.

  ### Returns

  URL.

  #### Parameters

  - ##### source: WMTS

    The WMTS source.

  #### Returns string

  - Defined in src/print/Service.js:485

Generated using TypeDoc