# GeoExt

### Navigation

- GeoExt »
- API Reference »
- `GeoExt.data` »
- `GeoExt.data.PrintPage`

# `GeoExt.data.PrintPage`

Extends
  - Ext.util.Observable

class `GeoExt.data.``PrintPage`

Provides a representation of a print page for `GeoExt.data.PrintProvider`. The extent of the page is stored as `OpenLayers.Feature.Vector`. Widgets can use this to display the print extent on the map.

## Config Options

Configuration properties in addition to those listed for Ext.util.Observable.

`customParams`
  `Object` Key-value pairs of additional parameters that the printProvider will send to the print service for this page.

`printProvider`
  `GeoExt.data.PrintProvider` The print provider to use with this page.

## Public Properties

Public properties in addition to those listed for Ext.util.Observable.

`PrintPage.``center`
  `OpenLayers.LonLat` The current center of the page. Read-only.

`PrintPage.``customParams`
  `Object` Key-value pairs of additional parameters that the printProvider will send to the print service for this page.

`PrintPage.``feature`
  `OpenLayers.Feature.Vector` Feature representing the page extent. To get the extent of the print page for a specific map, use `getPrintExtent`. Read-only.

`PrintPage.``rotation`
  `Float` The current rotation of the page. Read-only.

`PrintPage.``scale`
  `Ext.data.Record` The current scale record of the page. Read-only.

## Public Methods

Public methods in addition to those listed for Ext.util.Observable.

`PrintPage.``fit`()

  Parameters: | fitTo – `GeoExt.MapPanel` or `OpenLayers.Map` or `OpenLayers.Feature.Vector` The map or feature to fit the page to. options – `Object` Additional options to determine how to fit

  Fits the page layout to a map or feature extent. If the map extent has not been centered yet, this will do nothing.

  Available options:

  - mode - `String` How to calculate the print extent? If “closest”, the closest matching print extent will be chosen. If “printer”, the chosen print extent will be the closest one that can show the entire `fitTo` extent on the printer. If “screen”, it will be the closest one that is entirely visible inside the `fitTo` extent. Default is “printer”.

`PrintPage.``getPrintExtent`()

  Parameter: | map – `OpenLayers.Map` or `GeoExt.MapPanel` the map to get the print extent for.
  Returns: | `OpenLayers.Bounds`

  Gets this page’s print extent for the provided map.

`PrintPage.``setCenter`()

  Parameter: | center – `OpenLayers.LonLat` The new center.

  Moves the page extent to a new center.

`PrintPage.``setRotation`()

  Parameters: | rotation – `Float` The new rotation. force – `Boolean` If set to true, the rotation will also be set when the layout does not support it. Default is false.

  Sets a new rotation for the page geometry.

`PrintPage.``setScale`()

  Parameters: | scale – `Ext.data.Record` The new scale record. units – `String` map units to use for the scale calculation. Optional if the `feature` is on a layer which is added to a map. If not found, “dd” will be assumed.

  Updates the page geometry to match a given scale. Since this takes the current layout of the printProvider into account, this can be used to update the page geometry feature when the layout has changed.

## Events

Events in addition to those listed for Ext.util.Observable.

`change`

  Triggered when any of the page properties have changed

  Listener arguments:

  - printPage - `GeoExt.data.PrintPage` this printPage

  - modifications - `Object` Object with one or more of

      `scale`, `center` and `rotation`, notifying listeners of the changed properties.

### Navigation

- index
- modules |
- next |
- previous |
- GeoExt »
- API Reference »
- `GeoExt.data` »
- `GeoExt.data.PrintPage`