LayerPD_Layer
ObjectPDViewDest

A PDViewDest represents a particular view of a page in a document. It contains a reference to a page, a rectangle on that page, and information specifying how to adjust the view to fit the window's size and shape. It corresponds to a PDF Dest array (see Named Destinations in Section 8.2, Document-Level Navigation, in the PDF Reference) and can be considered a special form of a PDAction.

PDViewDest provides a number of methods to get or set the attributes describing the location and size of the view, including the page, rectangle, and fit style.



Define Summary
 Define
 PDViewDestNULL
Typedef Summary
 Typedef
 PDViewDestination
A particular view of a page in a document. It contains a reference to a page, a rectangle on that page, and information specifying how to adjust the view to fit the window's size and shape. It corresponds to a PDF Dest array and can be considered a special form of a PDAction.
Method Summary
 Method
 
PDViewDestination PDViewDestCreate(PDDoc doc, PDPage initialPage, ASAtom initialFitType, const ASFixedRectP initialRect, const ASFixed initialZoom, ASInt32 pageNumber)
Creates a new view destination object.
 
Deletes a view destination object. Before deleting a view destination, ensure that no link or bookmark refers to it.
 
PDViewDestination PDViewDestFromCosObj(CosObj obj)
Converts the specified Cos object to a view destination and verifies that the view destination is valid. This method does not copy the object, but is instead the logical equivalent of a type cast.
 
void PDViewDestGetAttr(PDViewDestination dest, ASInt32* pageNum, ASAtom* fitType, ASFixedRectP destRect, ASFixed* zoom)
Gets a view destination's fit type, destination rectangle, and zoom factor. The destination must be represented by an array, which is the case for a GoToR action.
 
Gets the Cos object corresponding to a view destination and verifies that the view destination is valid. This method does not copy the object, but is instead the logical equivalent of a type cast.
 
Tests whether a view destination is valid. This is intended only to ensure that the view destination has not been deleted, not to ensure that all necessary information is present and valid.
 
PDViewDestination PDViewDestResolve(PDViewDestination dest, PDDoc doc)
Resolves a destination. dest is the value of the D key in an action. It can be a real destination (an array) or a name. If it is a name, look it up in the doc parameter's Dests dictionary. The value found there can be a real destination (an array) or a dictionary. If it is a dictionary, look up the D key in that dictionary.
Defines Detail
PDViewDestNULL 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

#define PDViewDestNULL fixedNegativeInfinity

File: PDExpT.h
Line: 3278

Typedefs Detail
PDViewDestination 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef OPAQUE_64_BITS PDViewDestination;

A particular view of a page in a document. It contains a reference to a page, a rectangle on that page, and information specifying how to adjust the view to fit the window's size and shape. It corresponds to a PDF Dest array and can be considered a special form of a PDAction.

See Also


File: PDExpT.h
Line: 3273



Method Detail
PDViewDestCreate()
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDViewDestination PDViewDestCreate(PDDoc doc, PDPage initialPage, ASAtom initialFitType, const ASFixedRectP initialRect, const ASFixed initialZoom, ASInt32 pageNumber)

Creates a new view destination object.

Parameters

doc — 

The document in which the destination is used.

 
initialPage — 

The destination page.

 
initialFitType — 

The destination fit type. It must be one of the View Destination Fit Types, which must be converted into an ASAtom with ASAtomFromString().

 
initialRect — 

A pointer to an ASFixedRect specifying the destination rectangle, specified in user space coordinates. The appropriate information will be extracted from initialRect, depending on initialFitType, to create the destination. All four of the initialRect parameter's components should be set; using PDViewDestNULL for any components can result in incorrect results for rotated pages.

 
initialZoom — 

The zoom factor to set for the destination. Used only if initialFitType is XYZ. Use the predefined value PDViewDestNULL (see PDExpT.h) to indicate a NULL zoom factor, described in Table 8.2 in the PDF Reference.

 
pageNumber — 

Currently unused.

Returns

The newly created view destination.

See Also

Since

PI_PDMODEL_VERSION >= 0x00020000

File: PDProcs.h
Line: 4329
PDViewDestDestroy() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDViewDestDestroy(PDViewDestination dest)

Deletes a view destination object. Before deleting a view destination, ensure that no link or bookmark refers to it.

Parameters

dest — 

IN/OUT The view destination to destroy.

See Also

Since

PI_PDMODEL_VERSION >= 0x00020000

File: PDProcs.h
Line: 4341
PDViewDestFromCosObj() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDViewDestination PDViewDestFromCosObj(CosObj obj)

Converts the specified Cos object to a view destination and verifies that the view destination is valid. This method does not copy the object, but is instead the logical equivalent of a type cast.

Parameters

obj — 

IN/OUT The dictionary Cos object to convert to a view destination.

Returns

An array Cos object for the view destination.

See Also

Exceptions

pdErrBadAction is raised if the destination is invalid, as determined by PDViewDestIsValid().

Since

PI_PDMODEL_VERSION >= 0x00020000

File: PDProcs.h
Line: 4411
PDViewDestGetAttr() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDViewDestGetAttr(PDViewDestination dest, ASInt32* pageNum, ASAtom* fitType, ASFixedRectP destRect, ASFixed* zoom)

Gets a view destination's fit type, destination rectangle, and zoom factor. The destination must be represented by an array, which is the case for a GoToR action.

Parameters

dest — 

IN/OUT The view destination whose attributes are obtained.

 
pageNum — 

IN/OUT (Filled by the method) The page number of the destination's page.

 
fitType — 

IN/OUT (Filled by the method) The destination fit type. One of the values listed in View Destination Fit Types.

 
destRect — 

IN/OUT (Filled by the method) A pointer to a ASFixedRect containing the destination's rectangle, specified in user space coordinates.

 
zoom — 

IN/OUT (Filled by the method) The destination's zoom factor.

See Also

Exceptions

genErrBadParm is raised if the destination is not represented by an array.

Since

PI_PDMODEL_VERSION >= 0x00020000

File: PDProcs.h
Line: 4377
PDViewDestGetCosObj() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

CosObj PDViewDestGetCosObj(PDViewDestination dest)

Gets the Cos object corresponding to a view destination and verifies that the view destination is valid. This method does not copy the object, but is instead the logical equivalent of a type cast.

Parameters

dest — 

IN/OUT The view destination whose Cos object is obtained.

Returns

Array Cos object for the view destination. The contents of the array can be enumerated using CosObjEnum(). It returns a NULL Cos object if the view destination is invalid, as determined by PDViewDestIsValid().

See Also

Since

PI_PDMODEL_VERSION >= 0x00020000

File: PDProcs.h
Line: 4395
PDViewDestIsValid() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool PDViewDestIsValid(PDViewDestination dest)

Tests whether a view destination is valid. This is intended only to ensure that the view destination has not been deleted, not to ensure that all necessary information is present and valid.

Parameters

dest — 

The view destination whose validity is determined.

Returns

true if the view destination is valid, false otherwise.

Since

PI_PDMODEL_VERSION >= 0x00020000

File: PDProcs.h
Line: 4353
PDViewDestResolve() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDViewDestination PDViewDestResolve(PDViewDestination dest, PDDoc doc)

Resolves a destination. dest is the value of the D key in an action. It can be a real destination (an array) or a name. If it is a name, look it up in the doc parameter's Dests dictionary. The value found there can be a real destination (an array) or a dictionary. If it is a dictionary, look up the D key in that dictionary.

This method is useful for getting a PDViewDestination from an action, as provided by PDActionGetDest(), since this method may not return a PDViewDestination.

This method can raise memory, I/O, and parsing exceptions.

Parameters

dest — 

IN/OUT The destination to resolve.

 
doc — 

IN/OUT The PDDoc that contains the destination.

Returns

The resolved view destination.

See Also

Since

PI_PDMODEL_VERSION >= 0x00020002

File: PDProcs.h
Line: 5675