# PDF Edit Layer

> PDF Edit Layer: 37 components, 448 items.

- Product: Adobe PDF Library 21
- Language: Adobe C++
- Version: APDFL21.0.0PlusP1e
- HTML page: https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer
- Version index: https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/llms.txt

## Dump

### Functions (3)

#### PDEAttrEnumTable

```cpp
void PDEAttrEnumTable(IN PDEAttrEnumProc enumProc, IN void *clientData)
```

Header: `PERProcs.h:1304`

Enumerates the table of attributes. This method enumerates the shared resource objects. It is useful when looking for orphaned attributes.

**Parameters**

- `enumProc` (`IN PDEAttrEnumProc`): IN/OUT A callback to call for each attribute.
- `clientData` (`IN void *`): IN/OUT A pointer to user-supplied data to pass to `enumProc` each time it is called.

**Returns:** `void`

**Exceptions**

- `genErrBadParm`

#### PDELogDump

```cpp
void PDELogDump(IN PDEObjectDumpProc proc, IN void *clientData)
```

Header: `PERProcs.h:1291`

Enumerates the PDEObject objects. This is useful when looking for orphaned objects.

**Parameters**

- `proc` (`IN PDEObjectDumpProc`): A callback to call once for each PDEObject.
- `clientData` (`IN void *`): A pointer to user-supplied data to pass to `proc` each time it is called.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `peErrUnknownPDEColorSpace`
- `genErrBadParm`

**See also:** [`PDEObjectDump`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEObjectDump)

#### PDEObjectDump

```cpp
void PDEObjectDump(IN PDEObject obj, IN ASInt32 levels, IN PDEObjectDumpProc proc, IN void *clientData)
```

Header: `PERProcs.h:1276`

The object, its children and attributes are dumped. The dump contains information about each individual object. The output for child elements is indented with respect to their parents. • The information for each object is `char*` - the string describing Object Type. (See PDEObjectGetType()). • The number representing Object Type. (See `PEExpT.h`: PDEType `enum`). • The object reference count. • The memory location for the object.

**Parameters**

- `obj` (`IN PDEObject`): The PDEObject to dump.
- `levels` (`IN ASInt32`): The depth of children to dump.
- `proc` (`IN PDEObjectDumpProc`): A callback with the dump information; it may be called more than once per object.
- `clientData` (`IN void *`): Provided by the caller as the parameter of the same name for `proc`.

**Returns:** `void`

**Exceptions**

- `genErrBadParm`

**See also:** [`PDELogDump`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDELogDump)

### Typedefs (2)

#### PDEAttrEnumProc

```cpp
typedef ASBool(*) PDEAttrEnumProc(IN void *attrHdrP, IN ASUns32 refCount, IN ASUns16 size, IN void *clientData)(IN void *attrHdrP, IN ASUns32 refCount, IN ASUns16 size, IN void *clientData)
```

Header: `PEExpT.h:2142`

A callback for PDEAttrEnumTable(). It is called once for each attribute in a table.

**See also:** [`PDEAttrEnumTable`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEAttrEnumTable)

#### PDEObjectDumpProc

```cpp
typedef void(*) PDEObjectDumpProc(IN PDEObject obj, IN const char *dumpInfo, IN void *clientData)(IN PDEObject obj, IN const char *dumpInfo, IN void *clientData)
```

Header: `PEExpT.h:2124`

A callback for PDELogDump() or PDEObjectDump(). It is called once for each PDEObject, its children, and their attributes for the specified number of levels.

**See also:** [`PDELogDump`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDELogDump), [`PDEObjectDump`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEObjectDump)

## General

### Functions (5)

#### PDEDefaultGState

```cpp
void PDEDefaultGState(OUT PDEGraphicStateP stateP, IN ASInt32 stateSize)
```

Header: `PERProcs.h:1471`

Fills out a PDEGraphicStateP structure with the default graphic state. **Note:** Non-NULL objects in the graphic state, such as the fill and stroke color spaces, have their reference counts incremented by this method. Be sure to release these non- NULL objects when disposing of `stateP`.

**Parameters**

- `stateP` (`OUT PDEGraphicStateP`): (Filled by the method) A pointer to a `PDEGraphicState` structure with the default graphic state.
- `stateSize` (`IN ASInt32`): The size of the `stateP` structure in bytes.

**Returns:** `void`

#### PDEDefaultGStateEx

```cpp
void PDEDefaultGStateEx(OUT PDEGraphicStateExP stateP, IN ASInt32 stateSize)
```

Header: `PERProcs.h:3327`

Fills out a `PDEGraphicStateEx` structure which is higher precision alternative of `PDEGraphicState` structure with the default graphic state. **Note:** Non-NULL objects in the graphic state, such as the fill and stroke color spaces, have their reference counts incremented by this method. Be sure to release these non- NULL objects when disposing of `stateP`.

**Parameters**

- `stateP` (`OUT PDEGraphicStateExP`): (Filled by the method) A pointer to a `PDEGraphicStateEx` structure with the default graphic state.
- `stateSize` (`IN ASInt32`): The size of the `stateP` structure in bytes.

**Returns:** `void`

#### PDEMergeResourcesDict

```cpp
void PDEMergeResourcesDict(OUT CosObj *resDictP, IN CosDoc cosDoc, IN const CosObj *newResP)
```

Header: `PEWProcs.h:1072`

Merges two Resources dictionaries in the same CosDoc; you cannot merge two resource dictionaries from different CosDocs. Both dictionaries and what they reference must be in `cosDoc`. The objects referenced by `newResP` are appended to `resDictP`. This method only operates on the Cos dictionaries. It assumes there are no resource name conflicts. This method was useful for adding form resources to page resource dictionaries, but that is no longer necessary. **Note:** Since PDFEdit resolves resource names across PDEContent objects, this routine is safe for using with PDFEdit methods. This method may be unsafe if you modify streams and dictionaries outside of the PDFEdit API.

**Parameters**

- `resDictP` (`OUT CosObj *`): IN/OUT (Filled by the method) The dictionary to which `newResP` is merged. When the method completes, `resDictP` is the merged dictionary result.
- `cosDoc` (`IN CosDoc`): IN/OUT The CosDoc containing both dictionaries.
- `newResP` (`IN const CosObj *`): IN/OUT The dictionary to merge with `resDictP`.

**Returns:** `void`

**Exceptions**

- `genErrBadParm`

#### PDEPurgeCache

```cpp
void PDEPurgeCache(IN PDDoc doc)
```

Header: `PEWProcs.h:1312`

Clears the PDE Cache of this PDDoc. This method is only of interest to clients. **Note:** It is not recommended that you call this method directly; it is provided only for backwards compatibility.

**Parameters**

- `doc` (`IN PDDoc`): A PDDoc whose cache is purged.

**Returns:** `void`

#### PDEScratchDocCleanup

```cpp
void PDEScratchDocCleanup(void)
```

Header: `PEWProcs.h:3108`

Removes unused objects from the PDFEdit scratch document, which is used to hold representations of PDFEdit resources associated with a specific document.

**Parameters**

- (unnamed) (`void`)

**Returns:** `void`

### Typedefs (1)

#### ASFloat

```cpp
typedef float ASFloat
```

Header: `PEExpT.h:63`

### Structures (6)

#### PDEDoc

```cpp
typedef struct _t_PDEDoc* PDEDoc
```

Header: `PEExpT.h:403`

A reference to a PDEDoc.

#### PDEEmitStateP

```cpp
typedef struct _t_PDEEmitState* PDEEmitStateP
```

Header: `PEExpT.h:366`

A reference to the state of a writer.

#### PDEPage

```cpp
typedef struct _t_PDEPage* PDEPage
```

Header: `PEExpT.h:407`

A reference to a PDEPage.

#### PDEReader

```cpp
typedef struct _t_PDEReader* PDEReader
```

Header: `PEExpT.h:387`

An object used to read streams of PDEElement objects from page contents.

#### PDEState

```cpp
typedef struct _t_PDEState* PDEState
```

Header: `PEExpT.h:362`

A reference to the state of a reader.

#### PDEWriter

```cpp
typedef struct _t_PDEWriter* PDEWriter
```

Header: `PEExpT.h:391`

An object used to write streams of PDEElement objects to page content.

### Enums (3)

#### PDEEnumElementsFlags

Header: `PEExpT.h:1686`

A bit field for the PDEEnumElements() method.

**Values**

- `kPDEContentIgnoreMarkedContent = 0x0001`: Indicates whether Marked Content is ignored in the enumeration. This may be useful when generating elements purely for display purposes.
- `kPDEContentParsingAForm = 2`

**See also:** [`PDEEnumElements`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEEnumElements)

#### PDEGraphicStateWasSetFlags

Header: `PEExpT.h:622`

A structure describing the graphics state that was set.

**Values**

- `kPDEFillCSpaceWasSet = 0x0001`: A fill color space was set corresponding to the cs (`setcolorspace`) operator.
- `kPDEFillCValueWasSet = 0x0002`: A color fill value was set corresponding to the sc (`setcolor`) operator.
- `kPDEStrokeCSpaceWasSet = 0x0004`: A color space stroke value was set corresponding to the CS (`setcolorspace`) operator.
- `kPDEStrokeCValueWasSet = 0x0008`: A color stroke value was set corresponding to the SC (`setcolor`) operator.
- `kPDEDashWasSet = 0x0010`: A dash specification was set corresponding to the d (`setdash`) operator.
- `kPDELineWidthWasSet = 0x0020`: The line width was set corresponding to the w (`setlinewidth`) operator.
- `kPDEMiterLimitWasSet = 0x0040`: The miter limit was set corresponding to the M (`setmiterlimit`) operator.
- `kPDEFlatnessWasSet = 0x0080`: Line flatness was set corresponding to the i (`setflat`) operator.
- `kPDELineCapWasSet = 0x0100`: Line cap style was set corresponding to the J (`setlinecap`) operator.
- `kPDELineJoinWasSet = 0x0200`: Line join style was set corresponding to the j (`setlinejoin`) operator.
- `kPDERenderIntentWasSet = 0x0400`: A color rendering intent was set corresponding to the Intent key in the image dictionary.
- `kPDEExtGStateWasSet = 0x0800`: An extended graphics state was set corresponding to the gs operator.
- `kPDESoftMaskMatrixWasSet = 0x1000`: The soft mask matrix has been set
- `kPDEStateWasSetByPDEParse = 0x01000000`

**See also:** [`PDEDefaultGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEDefaultGState), [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd)

#### PDEType

Header: `PEExpT.h:1489`

The types of PDEObject, which is the superclass for PDEContent, PDEElement, PDEClip, and so on.

**Values**

- `kPDEContent = 0`: PDEContent object
- `kPDEText = 1`: PDEText object
- `kPDEPath = 2`: PDEPath object
- `kPDEImage = 3`: PDEImage object
- `kPDEForm = 4`: PDEForm object
- `kPDEPS = 5`: PDEPS object
- `kPDEXObject = 6`: PDEXObject object
- `kPDEClip = 7`: PDEClip object
- `kPDEFont = 8`: PDEFont object
- `kPDEColorSpace = 9`: PDEColorSpace object
- `kPDEExtGState = 10`: PDEExtGState object
- `kPDEPlace = 11`: PDEPlace object
- `kPDEContainer = 12`: PDEContainer object
- `kPDSysFont = 13`: PDSysFont object
- `kPDEPattern = 14`: PDEPattern object
- `kPDEDeviceNColors = 15`: PDEDeviceNColors object
- `kPDEShading = 16`: PDEShading object
- `kPDEGroup = 17`: PDEGroup object
- `kPDEUnknown = 18`: PDEUnknown object
- `kPDEBeginContainer = 19`: PDEBeginContainer object
- `kPDEEndContainer = 20`: PDEEndContainer object
- `kPDEBeginGroup = 21`: PDEBeginGroup object
- `kPDEEndGroup = 22`: PDEEndGroup object
- `kPDEXGroup = 23`: PDEXGroup object
- `kPDESoftMask = 24`: PDESoftMask object
- `kPDSysEncoding = 25`: PDSysEncoding object
- `kPDEDoc = 26`: PDEDoc object
- `kPDEPage = 27`: PDEPage object
- `kPDEReader = 28`: PDEReader object
- `kPDEWriter = 29`: PDEWriter object
- `kPDETextItem = 30`: PDETextItem object
- `kPDEImageFlate = 31`: PDEImageFlate object
- `kPDEImageJPX = 32`: PDEImageJPX object
- `kJPXColorSpace = 33`: JPXColorSpace object
- `kJPXPalette = 34`: JPXPalette object
- `kPDEGraphicFont = 35`
- `kPDELastType = 36`

**See also:** [`PDEObjectGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEObjectGetType)

### Definitions (7)

#### IN

Header: `PEExpT.h:73`

#### OUT

Header: `PEExpT.h:74`

#### PEX1

Header: `PEExpT.h:49`

Value: `ACEX1`

#### PEX2

Header: `PEExpT.h:50`

Value: `ACEX2`

#### kPDEAfterLast

Header: `PEExpT.h:1605`

Value: `(MAXInt32 - 1)`

#### kPDEBeforeFirst

Header: `PEExpT.h:1604`

Value: `((ASInt32)-1)`

#### kPDFStateSetAll

Header: `PEExpT.h:699`

Value: `((ASUns32)-1)`

## JPXColorSpace

### Functions (4)

#### JPXColorSpaceAcquireNext

```cpp
JPXColorSpace JPXColorSpaceAcquireNext(IN JPXColorSpace jpxColorSpace)
```

Header: `PERProcs.h:2915`

Acquires the next JPX color space defined with the JPX encoded image in the link list, if one exists. This object is acquired and must be released using PDERelease() when it is no longer in use. @since

**Parameters**

- `jpxColorSpace` (`IN JPXColorSpace`): IN/OUT A JPX color space object.

**Returns:** [`JPXColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXColorSpace)

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageJPXAcquireJPXColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquireJPXColorSpace)

#### JPXColorSpaceGetEnumAttrs

```cpp
ASBool JPXColorSpaceGetEnumAttrs(IN JPXColorSpace jpxColorSpace, OUT JPXCSEnumAttrsP jpxCSEnumAttrsP)
```

Header: `PERProcs.h:2949`

Gets the attributes of an enumerated color space. It returns `false` if the color space is not kJPXCSEnumerated.

**Parameters**

- `jpxColorSpace` (`IN JPXColorSpace`): IN/OUT A JPX color space object.
- `jpxCSEnumAttrsP` (`OUT JPXCSEnumAttrsP`): IN/OUT (filled in by the method) Attributes of a JPX
  enumerated color space.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if the JPX color space is kJPXCSEnumerated

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageJPXAcquireJPXColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquireJPXColorSpace)

#### JPXColorSpaceGetProfile

```cpp
ASInt32 JPXColorSpaceGetProfile(IN JPXColorSpace jpxColorSpace, OUT ASUns8 *profile, IN ASInt32 profileLength)
```

Header: `PERProcs.h:2966`

Gets the color profile of an ICC-based JPX color space. If `profile` is `0`, it returns the length of the profile in bytes; otherwise it returns the number of bytes copied to `profile`.

**Parameters**

- `jpxColorSpace` (`IN JPXColorSpace`): IN/OUT A JPX color space object.
- `profile` (`OUT ASUns8 *`): IN/OUT (Filled by the method) The profile of the JPX color space.
- `profileLength` (`IN ASInt32`): IN/OUT The byte length of the user-supplied profile buffer.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageJPXAcquireJPXColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquireJPXColorSpace)

#### JPXColorSpaceGetType

```cpp
JPXColorSpaceType JPXColorSpaceGetType(IN JPXColorSpace jpxColorSpace)
```

Header: `PERProcs.h:2934`

Returns the type of JPX color space: • kJPXCSUnknown • kJPXCSEnumerated • kJPXCSRestrictedICC • kJPXCSAnyICC • kJPXCSVenderColor @since

**Parameters**

- `jpxColorSpace` (`IN JPXColorSpace`): IN/OUT A JPX color space object.

**Returns:** [`JPXColorSpaceType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXColorSpaceType)

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageJPXAcquireJPXColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquireJPXColorSpace)

### Structures (1)

#### JPXColorSpace

```cpp
typedef struct _t_JPXColorSpace* JPXColorSpace
```

Header: `PEExpT.h:423`

A reference to a JPXColorSpace.

### Enums (1)

#### JPXColorSpaceType

Header: `PEExpT.h:2426`

JPX Color Space types.

**Values**

- `kJPXCSUnknown = 0x0000`
- `kJPXCSEnumerated = 0x0001`
- `kJPXCSRestrictedICC = 0x0002`
- `kJPXCSAnyICC = 0x0003`
- `kJPXCSVenderColor = 0x0004`

## JPXPalette

### Functions (4)

#### JPXPaletteGetBitDepths

```cpp
void JPXPaletteGetBitDepths(IN JPXPalette jpxPalette, OUT ASInt32 *bitDepths)
```

Header: `PERProcs.h:2871`

Returns the bit depths of the color values represented in the palette. The length of the array must be at least the number of components. @since

**Parameters**

- `jpxPalette` (`IN JPXPalette`): IN/OUT A JPX-encoded image object.
- `bitDepths` (`OUT ASInt32 *`): IN/OUT (Filled by the method) An array of bit depths for each component.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageJPXAcquirePalette`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquirePalette)

#### JPXPaletteGetNumComponents

```cpp
ASInt32 JPXPaletteGetNumComponents(IN JPXPalette jpxPalette)
```

Header: `PERProcs.h:2883`

Returns the number of color components represented by the palette. @since

**Parameters**

- `jpxPalette` (`IN JPXPalette`): IN/OUT A JPX encoded image object.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageJPXAcquirePalette`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquirePalette)

#### JPXPaletteGetNumEntries

```cpp
ASInt32 JPXPaletteGetNumEntries(IN JPXPalette jpxPalette)
```

Header: `PERProcs.h:2858`

Returns the number of palette entries. @since

**Parameters**

- `jpxPalette` (`IN JPXPalette`): IN/OUT A JPX encoded image object.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageJPXAcquirePalette`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquirePalette)

#### JPXPaletteGetTable

```cpp
ASStm JPXPaletteGetTable(IN JPXPalette jpxPalette, OUT ASInt32 *paletteLength)
```

Header: `PERProcs.h:2900`

Returns the palette data as a read only non-seekable ASStm. The returned ASStm should be read with ASStmRead(). Each component entry in the palette is represented by the number of bytes needed to contain the bit depth for that component. @since

**Parameters**

- `jpxPalette` (`IN JPXPalette`): IN/OUT A JPX encoded image object.
- `paletteLength` (`OUT ASInt32 *`): IN/OUT (Filled by the method) The length of the palette data.

**Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageJPXHasPalette`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXHasPalette), [`PDEImageJPXAcquirePalette`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquirePalette)

### Structures (1)

#### JPXPalette

```cpp
typedef struct _t_JPXPalette* JPXPalette
```

Header: `PEExpT.h:427`

A reference to a JPXPalette.

## PDEBeginContainer

### Functions (5)

#### PDEBeginContainerCreate

```cpp
PDEBeginContainer PDEBeginContainerCreate(IN ASAtom mcTag, IN CosObj *cosObjP, IN ASBool isInline)
```

Header: `PEWProcs.h:1653`

Creates a new PDEBeginContainer object. Call PDERelease to dispose of the returned PDEBeginContainer object when finished with it. Call PDERelease() to dispose of the returned PDEBeginContainer object when finished with it.

**Parameters**

- `mcTag` (`IN ASAtom`): IN/OUT The tag name for the marked-content sequence.
- `cosObjP` (`IN CosObj *`): IN/OUT (May be `NULL`) A CosDict object containing the property list for the sequence.
- `isInline` (`IN ASBool`): If `true`, it emits the container's dictionary into the content stream inline. If `false`, then the dictionary is emitted outside of the content stream and referenced by name. See the Property Lists section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.6.2, page 554. This document is provided on the web site of the International Standards Organization (ISO).

**Returns:** [`PDEBeginContainer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEBeginContainer)

The newly created object.

#### PDEBeginContainerGetDict

```cpp
ASBool PDEBeginContainerGetDict(IN PDEBeginContainer pdeBeginContainer, OUT CosObj *dictP, OUT ASBool *isInlineP)
```

Header: `PERProcs.h:1884`

Gets the property list dictionary associated with a PDEBeginContainer object. The property list is stored in a Cos dictionary. @note Either `dictP` or `isInlineP` may be `NULL` if that information is not required.

**Parameters**

- `pdeBeginContainer` (`IN PDEBeginContainer`): IN/OUT A PDEBeginContainer object.
- `dictP` (`OUT CosObj *`): IN/OUT (Filled by the method) The property list associated
  with the PDEBeginContainer.
- `isInlineP` (`OUT ASBool *`): IN/OUT (Filled by the method) If `true`, the dictionary
  is emitted into the page content stream inline.`true` if dictP points to a Cos dictionary; `false` otherwise.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

**Exceptions**

- `peErrWrongPDEObjectType`: if `pdeBeginContainer` is `NULL` or
  not the right type.

#### PDEBeginContainerGetMCTag

```cpp
ASAtom PDEBeginContainerGetMCTag(IN PDEBeginContainer pdeBeginContainer)
```

Header: `PERProcs.h:1864`

Gets the marked content tag associated with a PDEBeginContainer object.

**Parameters**

- `pdeBeginContainer` (`IN PDEBeginContainer`): IN/OUT A PDEBeginContainer object.

**Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)

The mark content tag.

**Exceptions**

- `peErrWrongPDEObjectType`: if pdeBeginContainer is `NULL` or not the right type.

**See also:** [`PDEBeginContainerSetMCTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEBeginContainerSetMCTag)

#### PDEBeginContainerSetDict

```cpp
void PDEBeginContainerSetDict(IN PDEBeginContainer pdeBeginContainer, IN CosObj *pdeBeginContainerDictP, IN ASBool isInline)
```

Header: `PEWProcs.h:1691`

Sets the property list for a PDEBeginContainer. The property list is passed as a Cos dictionary that can be emitted inline or referenced from the `\\Properties` key in the `\\Resources` dictionary of the containing stream. To learn about Property Lists for isInline, see the ISO 32000-:2008 document (1.7). This document is provided on the web site of the International Standards Organization (ISO). @note If cosObjP is `NULL`, the property list is cleared.

**Parameters**

- `pdeBeginContainer` (`IN PDEBeginContainer`): IN/OUT The PDEBeginContainer object.`NULL`) The Cos dictionary
  containing the property list.
- `pdeBeginContainerDictP` (`IN CosObj *`)
- `isInline` (`IN ASBool`): If `true`, it emits the container's dictionary into the content stream inline. If `false`, then the dictionary is emitted outside of the content stream and referenced by name. See the Property Lists section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.6.2, page 554.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`: is raised if `pdeBeginContainer` is `NULL` or not the right type.

#### PDEBeginContainerSetMCTag

```cpp
void PDEBeginContainerSetMCTag(IN PDEBeginContainer pdeBeginContainer, IN ASAtom mcTag)
```

Header: `PEWProcs.h:1665`

Sets the marked content tag for a PDEBeginContainer.

**Parameters**

- `pdeBeginContainer` (`IN PDEBeginContainer`): IN/OUT The PDEBeginContainer object.
- `mcTag` (`IN ASAtom`): IN/OUT The tag name.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`: if `pdeBeginContainer` is `NULL` or is not the right type.

### Structures (1)

#### PDEBeginContainer

```cpp
typedef struct _t_PDEBeginContainer* PDEBeginContainer
```

Header: `PEExpT.h:273`

The PDFEdit representation of the opening bracket of a marked-content sequence. Elements of this type must be paired with elements of type PDEEndContainer.

**See also:** `PDEElement (superclass)`, [`PDEBeginContainerCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEBeginContainerCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

## PDEBeginGroup

### Functions (1)

#### PDEBeginGroupCreate

```cpp
PDEBeginGroup PDEBeginGroupCreate()
```

Header: `PEWProcs.h:1997`

Creates a new begin group object. Call PDERelease() to dispose of the returned PDEBeginGroup object when finished with it.

**Returns:** [`PDEBeginGroup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEBeginGroup)

The newly created object.

### Structures (1)

#### PDEBeginGroup

```cpp
typedef struct _t_PDEBeginGroup* PDEBeginGroup
```

Header: `PEExpT.h:288`

A group of PDEElement objects on a page in a PDF file.

**See also:** `PDEElement (superclass)`, [`PDEBeginGroupCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEBeginGroupCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

## PDEClip

### Functions (7)

#### PDEClipAddElem

```cpp
void PDEClipAddElem(IN PDEClip clip, IN ASInt32 addAfterIndex, IN PDEElement pdeElement)
```

Header: `PEWProcs.h:656`

Adds an element to a clip path. **Note:** This method increments the reference count of `pdeElement`.

**Parameters**

- `clip` (`IN PDEClip`): IN/OUT The clip path to which an element is added.
- `addAfterIndex` (`IN ASInt32`): IN/OUT The index after which to add `pdeElement`. Use kPDEBeforeFirst to insert an element at the beginning of the clip object.
- `pdeElement` (`IN PDEElement`): IN/OUT The element added, which may be a PDEPath, a PDEText, a PDEContainer, a PDEGroup, or a PDEPlace object.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEClipRemoveElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipRemoveElems)

#### PDEClipCopy

```cpp
PDEClip PDEClipCopy(IN PDEClip srcClip)
```

Header: `PEWProcs.h:1555`

Makes a deep copy of a PDEClip object. Call PDERelease() to dispose of the returned clip object when finished with it. It raises an exception if it is unable to allocate memory.

**Parameters**

- `srcClip` (`IN PDEClip`): IN/OUT The clipping path to copy.

**Returns:** [`PDEClip`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClip)

The deep copy of `srcClip`.

#### PDEClipCreate

```cpp
PDEClip PDEClipCreate(void)
```

Header: `PEWProcs.h:689`

Creates an empty clip object. This represents a clipping object that has no effect on elements that refer to it. Call PDERelease() to dispose of the returned clip object when finished with it. It raises an exception if it is unable to allocate memory.

**Parameters**

- (unnamed) (`void`)

**Returns:** [`PDEClip`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClip)

The newly created clip object.

#### PDEClipFlattenedEnumElems

```cpp
ASBool PDEClipFlattenedEnumElems(IN PDEClip clip, IN PDEClipEnumProc enumProc, IN void *enumProcClientData)
```

Header: `PERProcs.h:1658`

For a given PDEClip, this enumerates all of the PDEElement objects in a flattened manner. In other words, PDEContainer objects and PDEGroup objects nested in the PDEClip will not be handed back, but any PDEPath objects and PDEText objects nested in them will be. Additionally, PDEPlace objects inside the PDEClip are not returned.

**Parameters**

- `clip` (`IN PDEClip`): The PDEClip to enumerate.
- `enumProc` (`IN PDEClipEnumProc`): Called with each flattened element. Enumeration continues until all elements have been enumerated, or until `enumProc` returns `false`.
- `enumProcClientData` (`IN void *`): A pointer to user-supplied data to pass to `enumProc` each time it is called.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

Returns the value of `enumProc`. It returns `true` if successful, `false` otherwise.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEClipCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipCreate), [`PDEClipGetElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipGetElem), [`PDEClipGetNumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipGetNumElems)

#### PDEClipGetElem

```cpp
PDEElement PDEClipGetElem(IN PDEClip clip, IN ASInt32 index)
```

Header: `PERProcs.h:962`

Gets an element from a clip object. **Note:** This method does not change the reference count of the returned PDEElement.

**Parameters**

- `clip` (`IN PDEClip`): IN/OUT The clip object from which an element is obtained.
- `index` (`IN ASInt32`): IN/OUT The index of the element to get from `clip`.

**Returns:** [`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)

The element from the clip object.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEClipGetNumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipGetNumElems)

#### PDEClipGetNumElems

```cpp
ASInt32 PDEClipGetNumElems(IN PDEClip clip)
```

Header: `PERProcs.h:945`

Gets the number of top-level elements in a clip object. Top-level elements may be a path or charpath, a marked content container or place, or a group. Paths are represented as PDEPath objects; charpaths are represented as PDEText objects. **Note:** PDEGroup is not a persistent object. You cannot save to PDF and re-get group objects.

**Parameters**

- `clip` (`IN PDEClip`): IN/OUT The clip object to examine.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The number of path and charpath elements in clip. If `clip` contains PDEGroup objects, this method returns the top-level PDEPath, PDEText, PDEContainer, PDEGroup, or PDEPlace object. Use PDEClipFlattenedEnumElems() to see only the PDEPath and PDEText objects.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEClipFlattenedEnumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipFlattenedEnumElems), [`PDEClipGetElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipGetElem)

#### PDEClipRemoveElems

```cpp
void PDEClipRemoveElems(IN PDEClip clip, IN ASInt32 index, IN ASInt32 count)
```

Header: `PEWProcs.h:674`

Removes one or more elements from a clip object. **Note:** This method decrements the reference count of each of the elements.

**Parameters**

- `clip` (`IN PDEClip`): IN/OUT The clip object from which an element is removed.
- `index` (`IN ASInt32`): IN/OUT The first element to remove.
- `count` (`IN ASInt32`): IN/OUT The number of elements to remove.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEClipAddElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipAddElem)

### Typedefs (1)

#### PDEClipEnumProc

```cpp
typedef ASBool(*) PDEClipEnumProc(IN PDEElement elem, IN void *clientData)(IN PDEElement elem, IN void *clientData)
```

Header: `PEExpT.h:2105`

A callback for PDEClipFlattenedEnumElems(), which enumerates all of a PDEClip object's PDEElement objects in a flattened manner.

**See also:** [`PDEClipFlattenedEnumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipFlattenedEnumElems)

### Structures (1)

#### PDEClip

```cpp
typedef struct _t_PDEClip* PDEClip
```

Header: `PEExpT.h:338`

A list of PDEElement objects containing a list of PDEPath objects and PDEText objects that describe a clip state. PDEClip objects can be created and built up with PDEClip methods. Any PDEElement object can have PDEClip associated with it. PDEClip objects can contain PDEContainer objects and PDEGroup objects to an arbitrary level of nesting. This allows PDEContainer objects to be used to mark clip objects. PDEGroup objects inside PDEClip objects that contain at least one PDEText and no PDEPath objects have a special meaning. All PDEText objects contained in such a PDEGroup are considered to be part of the same BT/ET block. This means that the union of these PDEText objects makes up a single clipping path, as opposed to the intersection of the PDEText objects.

**See also:** [`PDEClipCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipCreate), [`PDEElementGetClip`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetClip), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease), [`PDEClipFlattenedEnumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipFlattenedEnumElems)

## PDEColorSpace

### Functions (12)

#### PDEColorSpaceCreate

```cpp
PDEColorSpace PDEColorSpaceCreate(ASAtom family, PDEColorSpaceStruct *csStruct)
```

Header: `PEWProcs.h:1435`

Creates a new color space object of the specified type. Call PDERelease() to dispose of the returned color space object when finished with it. Type of names Names Device-dependent names `DeviceCMYK` `DeviceGray` `DeviceN` `DeviceRGB` Device-independent names `CalGray` `CalRGB` `Lab` `ICCBased` Special names `Indexed` `Pattern` `Separation`

**Parameters**

- `family` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): IN/OUT Supports all PDF 1.3 color spaces, which include:
- `csStruct` (`PDEColorSpaceStruct *`): IN/OUT Data for the type of color space you want to create.

**Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace)

The newly created color space object.

**Exceptions**

- `cosErrExpectedArray`
- `genErrBadParm`
- `peErrUnknownPDEColorSpace`

**See also:** [`PDEColorSpaceCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreateFromCosObj)

#### PDEColorSpaceCreateFromCosObj

```cpp
PDEColorSpace PDEColorSpaceCreateFromCosObj(IN const CosObj *cosObjP)
```

Header: `PEWProcs.h:956`

Creates a new color space object from a Cos object. Call PDERelease() to dispose of the returned color space object when finished with it. Type of names Names Device-dependent names `DeviceCMYK` `DeviceGray` `DeviceN` `DeviceRGB` Device-independent names `CalGray` `CalRGB` `Lab` `ICCBased` Special names `Indexed` `Pattern` `Separation`

**Parameters**

- `cosObjP` (`IN const CosObj *`): IN/OUT Supports all PDF 1.3 color spaces, which include:

**Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace)

The newly created color space object.

**Exceptions**

- `cosErrExpectedArray`
- `genErrBadParm`
- `peErrUnknownPDEColorSpace`

**See also:** [`PDEColorSpaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreate), [`PDEColorSpaceCreateFromName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreateFromName)

#### PDEColorSpaceCreateFromName

```cpp
PDEColorSpace PDEColorSpaceCreateFromName(IN ASAtom name)
```

Header: `PEWProcs.h:929`

Creates a new color space object. Call PDERelease() to dispose of the returned color space object when finished with it.

**Parameters**

- `name` (`IN ASAtom`): IN/OUT The ASAtom for the name of the color space created. The name must be one of the following: DeviceCMYK, DeviceGray, or DeviceRGB.

**Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace)

The newly created color space object.

**Exceptions**

- `cosErrExpectedName`
- `genErrBadParm`
- `peErrUnknownPDEColorSpace`

**See also:** [`PDEColorSpaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreate), [`PDEColorSpaceCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreateFromCosObj)

#### PDEColorSpaceCreateInCosDoc

```cpp
PDEColorSpace PDEColorSpaceCreateInCosDoc(IN ASAtom family, IN PDEColorSpaceStruct *csStruct, IN CosDoc cosDoc)
```

Header: `PEWProcs.h:3099`

Creates a color space object like PDEColorSpaceCreate(), except that the client can specify the CosDoc in which the color space object is created. Call PDERelease() to dispose of the returned color space object when finished with it. Type of names Names Device-dependent names `DeviceCMYK` `DeviceGray` `DeviceN` `DeviceRGB` Device-independent names `CalGray` `CalRGB` `Lab` `ICCBased` Special names `Indexed` `Pattern` `Separation`

**Parameters**

- `family` (`IN ASAtom`): IN/OUT Supports all PDF 1.3 color spaces, which include:
- `csStruct` (`IN PDEColorSpaceStruct *`): IN/OUT Data for the type of color space you want to create.
- `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of resource. It may be `NULL`.

**Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace)

The newly created color space object.

**Exceptions**

- `cosErrExpectedArray`
- `genErrBadParm`
- `peErrUnknownPDEColorSpace`

**See also:** [`PDEColorSpaceCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreateFromCosObj)

#### PDEColorSpaceGetBase

```cpp
ASAtom PDEColorSpaceGetBase(IN PDEColorSpace colorSpace)
```

Header: `PERProcs.h:1165`

Gets the name of the base color space. This is a helper routine for indexed color spaces. Call this method to obtain the base color space and color values for an uncolored pattern in PDFEdit. Note that the base color values are in the color array in the `PDEColorValue` field for stroke and fill of a PDEGraphicStateP. Or, they are in the `colorObj2` object if the base color space is DeviceN. To get the color values, a client gets the base color space, determines the type and number of components of the value, and looks them up in the `PDEColorValue` field.

**Parameters**

- `colorSpace` (`IN PDEColorSpace`): The base color space.

**Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)

The ASAtom for the name of the base color space. Use ASAtomGetString() to obtain a C string for the ASAtom.

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `peErrWrongPDEObjectType`

**See also:** [`PDEColorSpaceGetBaseNumComps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceGetBaseNumComps)

#### PDEColorSpaceGetBaseNumComps

```cpp
ASInt32 PDEColorSpaceGetBaseNumComps(IN PDEColorSpace colorSpace)
```

Header: `PERProcs.h:1456`

Gets the number of components in the base color space of an indexed color space. For example, for `[/ Indexed / DeviceRGB...]`, the number of components is `3`.

**Parameters**

- `colorSpace` (`IN PDEColorSpace`): IN/OUT The indexed color space.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The number of components in `colorSpace`.

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `peErrWrongPDEObjectType`

**See also:** [`PDEColorSpaceGetBase`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceGetBase), [`PDEColorSpaceGetNumComps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceGetNumComps)

#### PDEColorSpaceGetCTable

```cpp
void PDEColorSpaceGetCTable(IN PDEColorSpace colorSpace, OUT ASUns8 *colorTableP)
```

Header: `PERProcs.h:1197`

Gets the component information for an indexed color space.

**Parameters**

- `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space whose component information table is obtained.
- `colorTableP` (`OUT ASUns8 *`): IN/OUT (Filled by the method) The color lookup table, which is `numComps * (hiVal + 1)` bytes long, where `numComps` is the number of components in the base `colorSpace`. Each entry in the table contains `numComps` bytes, and the table is indexed from `0` to `hiVal`, where `hiVal` is the highest index in the color table. The table is indexed from `0` to `hival`, thus the table contains `hival + 1` entries.

**Returns:** `void`

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `peErrWrongPDEObjectType`

#### PDEColorSpaceGetCosObj

```cpp
void PDEColorSpaceGetCosObj(IN PDEColorSpace colorSpace, OUT CosObj *cosObjP)
```

Header: `PERProcs.h:1112`

Gets the CosObj representation of the color space object. For image masks, use PDEElementGetGState() to obtain color information.

**Parameters**

- `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space whose Cos object is obtained.
- `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the color space.

**Returns:** `void`

The Cos object for `colorSpace`. Any color space that is in the Resources dictionary of the page is returned as a Cos object.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEColorSpaceGetHiVal

```cpp
ASInt32 PDEColorSpaceGetHiVal(IN PDEColorSpace colorSpace)
```

Header: `PERProcs.h:1178`

Gets the highest index for the color lookup table for an indexed color space. Since the color table is indexed from zero to `hiVal`, the actual number of entries is `hiVal + 1`.

**Parameters**

- `colorSpace` (`IN PDEColorSpace`): IN/OUT An indexed color space.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The highest index (`hiVal`) in the color lookup table.

**Exceptions**

- `peErrUnknownPDEColorSpace`

#### PDEColorSpaceGetName

```cpp
ASAtom PDEColorSpaceGetName(IN PDEColorSpace colorSpace)
```

Header: `PERProcs.h:1094`

Gets the name of a color space object. Type of names Names Device-dependent names `DeviceCMYK` `DeviceGray` `DeviceN` `DeviceRGB` Device-independent names `CalGray` `CalRGB` `Lab` `ICCBased` Special names `Indexed` `Pattern` `Separation`

**Parameters**

- `colorSpace` (`IN PDEColorSpace`): IN/OUT A color space object.

**Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)

The color space object's name. It supports all PDF 1.3 color spaces, which include:

**Exceptions**

- `peErrUnknownPDEColorSpace`

#### PDEColorSpaceGetNumComps

```cpp
ASInt32 PDEColorSpaceGetNumComps(IN PDEColorSpace colorSpace)
```

Header: `PERProcs.h:1141`

Calculates the number of components in a color space. Color space Return value DeviceGray `1` CalGray `1` Separation `1` DeviceRGB `3` CalRGB `3` DeviceCMYK `4` Lab `4` DeviceN The number of components dependent on the specific color space object. ICCBased The number of components dependent on the specific color space object. Indexed `1` Call PDEColorSpaceGetBaseNumComps() to get the number of components in the base color space.

**Parameters**

- `colorSpace` (`IN PDEColorSpace`): IN/OUT A color space object.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The number of components in `colorSpace`:

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `peErrWrongPDEObjectType`

**See also:** [`PDEColorSpaceGetBaseNumComps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceGetBaseNumComps)

#### PDEColorSpaceGetStruct

```cpp
void PDEColorSpaceGetStruct(IN PDEColorSpace cs, OUT PDEColorSpaceStruct *pdeColorSpaceStruct)
```

Header: `PERProcs.h:2980`

Retrieves a `PDEColorSpaceStruct` from a `PDEColorSpace`. It supports all PDF version 1.3 color spaces except the `Pattern` color space. It is the responsibility of the caller to free the `PDEColorSpaceStruct` and the underlying allocations.

**Parameters**

- `cs` (`IN PDEColorSpace`): IN/OUT The `PDEColorSpace` for which the structure is required.
- `pdeColorSpaceStruct` (`OUT PDEColorSpaceStruct *`): IN/OUT The `PDEColorSpaceStruct` created for the color space.

**Returns:** `void`

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `genErrBadParm`

**See also:** [`PDEColorSpaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreate)

### Typedefs (3)

#### PDEBlackPointFlt

```cpp
typedef PDEXYZColorFlt PDEBlackPointFlt
```

Header: `PEExpT.h:2170`

A structure describing a black point in a calibrated color space.

**See also:** [`PDEColorSpaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreate)

#### PDEPatternColorSpace

```cpp
typedef PDEColorSpace PDEPatternColorSpace
```

Header: `PEExpT.h:2245`

A PDEColorSpace that describes a Pattern color space.

**See also:** [`PDEColorSpaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreate)

#### PDEWhitePointFlt

```cpp
typedef PDEXYZColorFlt PDEWhitePointFlt
```

Header: `PEExpT.h:2164`

A structure describing a white point in a calibrated color space.

**See also:** [`PDEColorSpaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreate)

### Structures (1)

#### PDEColorSpace

```cpp
typedef struct _t_PDEColorSpace* PDEColorSpace
```

Header: `PEExpT.h:322`

A reference to a color space used on a page in a PDF file. The color space is part of the graphics state attributes of a PDEElement.

**See also:** [`PDEColorSpaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreate), [`PDEColorSpaceCreateFromName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreateFromName), [`PDEImageGetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpace), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

## PDEContainer

### Functions (7)

#### PDEContainerCreate

```cpp
PDEContainer PDEContainerCreate(IN ASAtom mcTag, IN CosObj *cosObjP, IN ASBool isInline)
```

Header: `PEWProcs.h:1180`

Creates a container object. Call PDERelease() to dispose of the returned container object when finished with it.

**Parameters**

- `mcTag` (`IN ASAtom`): IN/OUT The tag name for the container.
- `cosObjP` (`IN CosObj *`): IN/OUT An optional Marked Content dictionary for the container.
- `isInline` (`IN ASBool`): If `true`, it emits the container's dictionary into the content stream inline. If `false`, then the dictionary is emitted outside of the content stream and referenced by name. See the Property Lists section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.6.2, page 554. This document is provided on the web site of the International Standards Organization (ISO).

**Returns:** [`PDEContainer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainer)

The newly created container object.

**Exceptions**

- `pdErrOpNotPermitted`

**See also:** [`PDEContainerGetMCTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerGetMCTag), [`PDEContainerSetMCTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerSetMCTag)

#### PDEContainerGetContent

```cpp
PDEContent PDEContainerGetContent(IN PDEContainer pdeContainer)
```

Header: `PERProcs.h:1438`

Gets the PDEContent for a PDEContainer. **Note:** This method does not change the reference count of the returned PDEContent.

**Parameters**

- `pdeContainer` (`IN PDEContainer`): IN/OUT The container whose content is obtained.

**Returns:** [`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent)

The PDEContent for the `pdeContainer`.

**Exceptions**

- `pdErrOpNotPermitted`
- `peErrWrongPDEObjectType`

**See also:** [`PDEContainerSetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerSetContent)

#### PDEContainerGetDict

```cpp
ASBool PDEContainerGetDict(IN PDEContainer pdeContainer, OUT CosObj *placeDictP, OUT ASBool *isInline)
```

Header: `PERProcs.h:1422`

Gets the Marked Content dictionary for a container.

**Parameters**

- `pdeContainer` (`IN PDEContainer`): IN/OUT A container.
- `placeDictP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Marked Content
  dictionary for `pdeContainer`. `NULL` if `pdeContainer` has
  no Marked Content dictionary.
- `isInline` (`OUT ASBool *`): IN/OUT (Filled by the method) `true` if the dictionary is inline, `false` otherwise. It is undefined if `pdeContainer` has no Marked Content dictionary.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if `pdeContainer` has a Marked Content dictionary, `false` otherwise.

**Exceptions**

- `peErrWrongPDEObjectType`
- `cosErrInvalidObj`

**See also:** [`PDEContainerSetDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerSetDict)

#### PDEContainerGetMCTag

```cpp
ASAtom PDEContainerGetMCTag(IN PDEContainer pdeContainer)
```

Header: `PERProcs.h:1403`

Gets the Marked Content tag for a container.

**Parameters**

- `pdeContainer` (`IN PDEContainer`): IN/OUT A container.

**Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)

The Marked Content tag of `pdeContainer`. It returns ASAtomNull if `pdeContainer` has no Marked Content tag.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEContainerCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerCreate), [`PDEContainerSetMCTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerSetMCTag)

#### PDEContainerSetContent

```cpp
void PDEContainerSetContent(IN PDEContainer pdeContainer, IN PDEContent pdeContent)
```

Header: `PEWProcs.h:1233`

Sets the content for a container. The existing PDEContent is released by this method. **Note:** This method decrements the reference count of the previous content of the container and increments the reference count of the new PDEContent.

**Parameters**

- `pdeContainer` (`IN PDEContainer`): IN/OUT A container.
- `pdeContent` (`IN PDEContent`): IN/OUT The content of `pdeContainer`.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEContainerGetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerGetContent)

#### PDEContainerSetDict

```cpp
void PDEContainerSetDict(IN PDEContainer pdeContainer, IN CosObj *placeDictP, IN ASBool isInline)
```

Header: `PEWProcs.h:1216`

Sets the Marked Content dictionary for a PDEContainer. The dictionary can be emitted inline or referenced from the `\Properties` key in the `\Resources` dictionary of the containing stream.

**Parameters**

- `pdeContainer` (`IN PDEContainer`): The container whose dictionary is changed.
- `placeDictP` (`IN CosObj *`): The Marked Content dictionary being set into `pdeContainer`.
- `isInline` (`IN ASBool`): If `true`, it emits the container's dictionary into the content stream inline. If `false`, then the dictionary is emitted outside of the content stream and referenced by name. See the Property Lists section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.6.2, page 554. This document is provided on the web site of the International Standards Organization (ISO).

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEContainerGetDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerGetDict)

#### PDEContainerSetMCTag

```cpp
void PDEContainerSetMCTag(IN PDEContainer pdeContainer, IN ASAtom mcTag)
```

Header: `PEWProcs.h:1193`

Sets the Marked Content tag for a PDEContainer.

**Parameters**

- `pdeContainer` (`IN PDEContainer`): IN/OUT The container to tag.
- `mcTag` (`IN ASAtom`): IN/OUT The Marked Content tag.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEContainerCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerCreate), [`PDEContainerGetMCTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerGetMCTag)

### Structures (1)

#### PDEContainer

```cpp
typedef struct _t_PDEContainer* PDEContainer
```

Header: `PEExpT.h:248`

A group of PDEElement objects on a page in a PDF file. In the PDF file, containers are delimited by Marked Content BMC/EMC or BDC/EMC pairs. Every PDEContainer has a Marked Content tag associated with it. In addition to grouping a set of elements, a BDC/EMC pair specifies a property list to be associated with the grouping. Thus, a PDEContainer corresponding to a BDC/EMC pair also has a property list dictionary associated with it.

**See also:** [`PDEContainerCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

## PDEContent

### Functions (20)

#### PDEContentAddElem

```cpp
void PDEContentAddElem(IN PDEContent pdeContent, IN ASInt32 addAfterIndex, IN PDEElement pdeElement)
```

Header: `PEWProcs.h:145`

Inserts an element into a PDEContent. **Note:** This method increments the reference count of `pdeElement`.

**Parameters**

- `pdeContent` (`IN PDEContent`): The content to which `pdeElement` is added.
- `addAfterIndex` (`IN ASInt32`): The location after which `pdeElement` is added. It should be kPDEBeforeFirst to add to the beginning of the display list.
- `pdeElement` (`IN PDEElement`): The element to add to `pdeContent`. The reference count of `pdeElement` is incremented.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEContentRemoveElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentRemoveElem)

#### PDEContentAddPage

```cpp
void PDEContentAddPage(OUT PDEContent theContent, IN ASInt32 insertAfterIndex, IN CosDoc containerDoc, IN PDPage srcPage, IN ASFixedMatrix *dstMatrix, IN ASAtom annotTypes[], IN ASInt32 flags, IN ASFixedRect *bbox)
```

Header: `PEWProcs.h:1606`

Superseded by PDEContentAddPageEx() in Acrobat 10.0. Adds the specfied PDPage to the PDEContent as an Xobject form. It adds a reference to the Xobject form at the indicated index in the PDE Content; the index may be less than `0`, which indicates the object is to be appended to the content.

**Parameters**

- `theContent` (`OUT PDEContent`): The content to set for the page.
- `insertAfterIndex` (`IN ASInt32`): The index indicates the location after which the specified element is to be added. The index should be kPDBeforeFirst to add to the beginning of the display list.
- `containerDoc` (`IN CosDoc`): The CosDoc in which the page is contained.
- `srcPage` (`IN PDPage`): The page that will be inserted at `insertAfterIndex` in `theContent`.
- `dstMatrix` (`IN ASFixedMatrix *`): (May be `NULL`) The matrix applied to the default matrix of the PDPage that is inserted into the CosDoc.
- `annotTypes` (`IN ASAtom`): If the page contains annotations, the `annotTypes` list is used to determine which annotation types are pumped into the page contents of the CosDoc. This list is a list of atoms of the subtypes of annotations to be included. When the list is NULL, all Annotations are excluded. NOTE: The annotations included will not be included AS annotations. Rather, visible Annotations will be included in content.
- `flags` (`IN ASInt32`): (May be `0`) - may be one of:
  Value
  Description

  kAnnotAll
  Copy all annotation types. If this is not set, then the `annotTypes` list will be consulted.

  kDoNotMergeFonts
  Do not merge duplicate fonts when copying.
- `bbox` (`IN ASFixedRect *`): (May be `NULL`) specifies the destination `BBox` for the page being inserted. If it is `NULL`, the new page's media box is used.

**Returns:** `void`

**See also:** [`PDEContentAddPageEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentAddPageEx)

#### PDEContentAddPageEx

```cpp
void PDEContentAddPageEx(OUT PDEContent theContent, IN ASInt32 insertAfterIndex, IN CosDoc containerDoc, IN PDPage srcPage, IN ASDoubleMatrix *dstMatrix, IN ASAtom annotTypes[], IN ASInt32 flags, IN ASDoubleRect *bbox)
```

Header: `PEWProcs.h:3278`

Adds the specfied PDPage to the PDEContent as an Xobject form. Supersedes PDEContentAddPage() in Acrobat 10.0. It adds a reference to the Xobject form at the indicated index in the PDE Content; the index may be less than `0`, which indicates the object is to be appended to the content.

**Parameters**

- `theContent` (`OUT PDEContent`): The content to set for the page.
- `insertAfterIndex` (`IN ASInt32`): The index indicates the location after which the specified element is to be added. The index should be kPDBeforeFirst to add to the beginning of the display list.
- `containerDoc` (`IN CosDoc`): The CosDoc in which the page is contained.
- `srcPage` (`IN PDPage`): The page that will be inserted at `insertAfterIndex` in `theContent`.
- `dstMatrix` (`IN ASDoubleMatrix *`): (May be `NULL`) The matrix applied to the default matrix of the PDPage that is inserted into the CosDoc.
- `annotTypes` (`IN ASAtom`): If the page contains annotations, the `annotTypes` list is used to determine which annotation types are pumped into the page contents of the CosDoc. This list is a list of atoms of the subtypes of annotations to be included. When the list is NULL, all Annotations are excluded. NOTE: The annotations included will not be included AS annotations. Rather, visible Annotations will be included in content.
- `flags` (`IN ASInt32`): (May be `0`) - may be one of:
  Value
  Description

  kAnnotAll
  Copy all annotation types. If this is not set, then the `annotTypes` list will be consulted.

  kDoNotMergeFonts
  Do not merge duplicate fonts when copying.
- `bbox` (`IN ASDoubleRect *`): (May be `NULL`) specifies the destination `BBox` for the page being inserted. If it is `NULL`, the new page's media box is used.

**Returns:** `void`

**See also:** [`PDEContentAddPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentAddPage)

#### PDEContentCopyResTable

```cpp
void PDEContentCopyResTable(PDEContent src, PDEContent dst)
```

Header: `PERProcs.h:3460`

Copies ResTable indexes count from source PDEContent to destination PDEContent.

**Parameters**

- `src` ([`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent))
- `dst` ([`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent))

**Returns:** `void`

None

**Since:** `PDFEditReadHFT_VERSION_10`

#### PDEContentCreate

```cpp
PDEContent PDEContentCreate(void)
```

Header: `PEWProcs.h:49`

Creates an empty content object. Call PDERelease() to dispose of the returned content object when finished with it. **Note:** Do not use this method to create a PDEContent to be put into a PDPage. Instead, call PDPageAcquirePDEContent().

**Parameters**

- (unnamed) (`void`)

**Returns:** [`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent)

An empty content object.

**Exceptions**

- `peErrPStackUnderflow`

**See also:** [`PDEContentCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentCreateFromCosObj), [`PDPageAcquirePDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAcquirePDEContent)

#### PDEContentCreateFromCosObj

```cpp
PDEContent PDEContentCreateFromCosObj(const CosObj *contents, const CosObj *resources)
```

Header: `PERProcs.h:108`

Creates a content object from a Cos object. This is the main method for obtaining a PDEContent object. Call PDERelease() to dispose of the returned content object when finished with it.

**Parameters**

- `contents` ([`const CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT A Cos object that is the source for the content. It may be page contents, a Form XObject, a Type 3 font CharProc, or an appearance dictionary for an annotation.
- `resources` ([`const CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The object's Resources dictionary. If the Form or Type 3 font or appearance dictionary contains a Resources dictionary, this dictionary must be passed in `resources`. Otherwise, it must be the page resources object of the page containing the Form or Type 3 font contents object.

**Returns:** [`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent)

The content from the Cos object.

**Exceptions**

- `pdErrOpNotPermitted`
- `peErrPStackUnderflow`

**See also:** [`PDEContentCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentCreate), [`PDEContentToCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentToCosObj)

#### PDEContentFlattenOC

```cpp
ASBool PDEContentFlattenOC(PDEContent content, PDOCContext context)
```

Header: `PEWProcs.h:2335`

Flattens the content, removing any PDEElement objects that are not visible in the given optional-content context, and removing the optional-content information from any visible PDFElement objects.

**Parameters**

- `content` ([`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent)): The content to be modified.
- `context` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The optional-content context in which `content` is checked for visibility.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if the operation is successful, `false` otherwise.

**See also:** [`PDDocFlattenOC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocFlattenOC), [`PDPageFlattenOC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageFlattenOC)

#### PDEContentGetAttrs

```cpp
void PDEContentGetAttrs(IN PDEContent pdeContent, OUT PDEContentAttrsP attrsP, IN ASUns32 attrsSize)
```

Header: `PERProcs.h:120`

Gets the attributes of a content.

**Parameters**

- `pdeContent` (`IN PDEContent`): IN/OUT A content object.
- `attrsP` (`OUT PDEContentAttrsP`): IN/OUT (Filled by the method) A pointer to a `PDEContentAttrs` structure containing the attributes of the content.
- `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEContentGetDefaultColorSpace

```cpp
PDEColorSpace PDEContentGetDefaultColorSpace(IN PDEContent pdeContent, IN ASAtom colorSpaceName)
```

Header: `PERProcs.h:1831`

Gets a default color space from a PDEContent object. See the "Default Color Spaces" section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, under "CIE-Based Color Spaces" in section 8.6.5.6, page 152. You can find this document on the web store of the International Standards Organization (ISO). @note This method does not change the reference count of the returned PDEColorSpace. @since

**Parameters**

- `pdeContent` (`IN PDEContent`): IN/OUT A content object.
- `colorSpaceName` (`IN ASAtom`): IN/OUT An ASAtom for the name of the desired
  color space. It must be an ASAtom for one of DefaultRGB, DefaultCMYK,
  or DefaultGray.

**Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace)

**See also:** [`PDEContentGetNumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetNumElems)

#### PDEContentGetElem

```cpp
PDEElement PDEContentGetElem(IN PDEContent pdeContent, IN ASInt32 index)
```

Header: `PERProcs.h:170`

Gets the requested element from a content. **Note:** This method does not change the reference count of the element. **Note:** This method does not copy the element.

**Parameters**

- `pdeContent` (`IN PDEContent`): IN/OUT A content object.
- `index` (`IN ASInt32`): IN/OUT The index of element to obtain.

**Returns:** [`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)

The requested element.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEContentGetNumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetNumElems)

#### PDEContentGetElemsStatus

```cpp
ASUns32 PDEContentGetElemsStatus(IN PDEContent pdeContent)
```

Header: `PERProcs.h:3410`

**Parameters**

- `pdeContent` (`IN PDEContent`)

**Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)

#### PDEContentGetNumElems

```cpp
ASInt32 PDEContentGetNumElems(IN PDEContent pdeContent)
```

Header: `PERProcs.h:153`

Gets the number of elements in a PDEContent object.

**Parameters**

- `pdeContent` (`IN PDEContent`): IN/OUT A content object.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The number of elements in `pdeContent`.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEContentGetElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetElem)

#### PDEContentGetResources

```cpp
ASInt32 PDEContentGetResources(IN PDEContent pdeContent, IN ASInt32 type, OUT PDEObject *resourcesP)
```

Header: `PERProcs.h:142`

Gets the number of resources of the specified type and, optionally, gets the pointers to the resource objects.

**Parameters**

- `pdeContent` (`IN PDEContent`): IN/OUT A content object.
- `type` (`IN ASInt32`): IN/OUT The type of resources to query or obtain: PDEFont, PDEXGroup, or PDEColorSpace. It must be one of PDEContentGetResourceFlags.
- `resourcesP` (`OUT PDEObject *`): IN/OUT (Filled by the method) If non-`NULL`, it must point to an array of PDEObject pointers. On return, the array contains pointers to the requested resources. If `resourcesP` is `NULL`, only the number of resources of `type` is returned. Note that the object in `resourcesP` may only be valid for this method. Use PDEAcquire() if you need to hold on to the object longer than the scope of `resourcesP`.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The number of resources of `type` returned in `resourcesP`.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

#### PDEContentRemoveElem

```cpp
void PDEContentRemoveElem(IN PDEContent pdeContent, IN ASInt32 index)
```

Header: `PEWProcs.h:125`

Removes an element from a PDEContent. **Note:** This decrements the reference count of the element removed.

**Parameters**

- `pdeContent` (`IN PDEContent`): IN/OUT A content object.
- `index` (`IN ASInt32`): IN/OUT The index in `pdeContent` of the element to remove whose reference count is decremented.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEContentAddElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentAddElem)

#### PDEContentSetContainingStream

```cpp
void PDEContentSetContainingStream(IN PDEContent pdeContent, IN CosObj containingStm)
```

Header: `PEWProcs.h:2732`

Sets the containing stream and owner stream for any marked content reference handles attached to containers within the content. **Note:** This call should not be used when the content is being directly added to a page. **Note:** If the content is set with PDPageSetPDEContent(), PDEFormSetContent(), or PDEGroupSetContent(), this step occurs automatically.

**Parameters**

- `pdeContent` (`IN PDEContent`): The content stream within which to update marked content references.
- `containingStm` (`IN CosObj`): The containing stream object for the content stream.

**Returns:** `void`

**See also:** [`PDEContentSetPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentSetPage), [`PDEContentSetStreamOwner`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentSetStreamOwner)

#### PDEContentSetDefaultColorSpace_PEWCalls_

```cpp
void PDEContentSetDefaultColorSpace_PEWCalls_(IN PDEContent pdeContent, IN ASAtom colorSpaceName, IN PDEColorSpace colorSpace)
```

Header: `PEWProcs.h:3136`

Sets the default color space in a PDEContent object. The reference count on any existing default color space is decremented, and the reference count on the new color space is incremented. Note that the new color space can be `NULL`, indicating that there is no default color space. See the "Default Color Spaces" section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, under "CIE-Based Color Spaces" in section 8.6.5.6, page 152. You can find this document on the web store of the International Standards Organization (ISO).

**Parameters**

- `pdeContent` (`IN PDEContent`): IN A content object.
- `colorSpaceName` (`IN ASAtom`): IN An ASAtom for the name of the desired color space. It must be an ASAtom for one of the following:

  • `DefaultRGB`

  • `DefaultCMYK`

  • `DefaultGray`
- `colorSpace` (`IN PDEColorSpace`): IN The color space to use as the default.

**Returns:** `void`

#### PDEContentSetElemsStatus

```cpp
void PDEContentSetElemsStatus(IN PDEContent pdeContent, IN ASUns32 status)
```

Header: `PERProcs.h:3411`

**Parameters**

- `pdeContent` (`IN PDEContent`)
- `status` (`IN ASUns32`)

**Returns:** `void`

#### PDEContentSetPage

```cpp
void PDEContentSetPage(IN PDEContent pdeContent, IN CosObj pageObj)
```

Header: `PEWProcs.h:2713`

Sets the page on which marked content is drawn upon for any marked content reference handles attached to containers within the content. **Note:** If content is set with PDPageSetPDEContent(), PDEFormSetContent(), or PDEGroupSetContent(), this step occurs automatically. **Note:** This call should only be used when the content is being directly added to a page.

**Parameters**

- `pdeContent` (`IN PDEContent`): The content stream whose marked content reference handles should be updated.
- `pageObj` (`IN CosObj`): The page object upon which contents are drawn.

**Returns:** `void`

**See also:** [`PDEContentSetContainingStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentSetContainingStream), [`PDEContentSetStreamOwner`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentSetStreamOwner), [`PDSMCRefCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSMCRefCreate)

#### PDEContentSetStreamOwner

```cpp
void PDEContentSetStreamOwner(IN PDEContent pdeContent, IN CosObj streamOwner)
```

Header: `PEWProcs.h:2750`

Sets the stream owner for any marked content reference handles attached to containers within the content. **Note:** This call should not be used when the content is being directly added to a page. **Note:** If content is set with PDPageSetPDEContent(), PDEFormSetContent(), or PDEGroupSetContent(), this step occurs automatically.

**Parameters**

- `pdeContent` (`IN PDEContent`): The content stream within which to update marked content references.
- `streamOwner` (`IN CosObj`): The owner object for any references attached to the content.

**Returns:** `void`

**See also:** [`PDEContentSetPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentSetPage), [`PDEContentSetContainingStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentSetContainingStream)

#### PDEContentToCosObj

```cpp
void PDEContentToCosObj(IN PDEContent pdeContent, IN ASUns32 flags, IN PDEContentAttrsP attrs, IN ASUns32 attrsSize, IN CosDoc cosDoc, IN PDEFilterArrayP filtersP, OUT CosObj *contentsP, OUT CosObj *resourcesP)
```

Header: `PEWProcs.h:100`

This is the main method for converting a PDEContent into PDF contents and resources. This method does not change the PDEContent object or its reference count. The caller of this function is responsible for adding the contents and the resources returned from this method to the Page Object.

**Parameters**

- `pdeContent` (`IN PDEContent`): IN/OUT A content object.
- `flags` (`IN ASUns32`): IN/OUT Flags specifying the type of object to create
  (page contents, form, or charproc) and how it is created.
  It must be one or more of PDEContentToCosObjFlags.
- `attrs` (`IN PDEContentAttrsP`): IN/OUT A pointer to a PDEContentAttrs structure that
  contains the appropriate form attributes or cache device/char-width attributes, and so on.
  If it is zero, no attributes are set.
- `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrs` buffer in bytes. Zero
  if `attrs` is zero.
- `cosDoc` (`IN CosDoc`): IN/OUT The document in which the contents and resources
  are created.
- `filtersP` (`IN PDEFilterArrayP`): IN/OUT A pointer to a PDEFilterArray structure
  that specifies which filters to use in encoding the contents;
  it may be `NULL`. If `filtersP` contains any `encodeParms`,
  they must belong to `cosDoc`.

  **Note:** Do not use this method to put a PDEContent into a PDPage. Instead, call PDPageSetPDEContent().
- `contentsP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the resulting contents in `pdeContent`.
- `resourcesP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the resulting resources in `pdeContent`. Note that the client is responsible for putting the `resourcesP` dictionary into the `contentsP` stream for non-page objects. The client must do this for XObject Forms and appearance dictionaries in annotations. For Type 3 fonts, the resource dictionaries must be merged and put into the Type 3 font dictionary. For a page, the contents and resources must be put into the page object.

**Returns:** `void`

**Exceptions**

- `peErrUnknownResType`
- `pageErrErrorParsingImage`
- `pdErrBadResMetrics`
- `peErrWrongPDEObjectType`
- `peErrUnknownPDEColorSpace`

**See also:** [`PDEContentCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentCreateFromCosObj)

### Structures (1)

#### PDEContent

```cpp
typedef struct _t_PDEContent* PDEContent
```

Header: `PEExpT.h:122`

Contains the modifiable contents of a PDPage. A PDEContent object may be obtained from an existing page, from a Form XObject, or from a Type 3 CharProc. You can create an empty PDEContent object. A PDEContent object contains PDEElement objects. In addition, a PDEContent object may have attributes such as a Form matrix and `setcachedevice` parameters.

**See also:** [`PDEContentCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentCreate), [`PDEContainerGetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerGetContent), [`PDEContentCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentCreateFromCosObj), [`PDEFormGetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetContent), [`PDPageAcquirePDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAcquirePDEContent), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

### Enums (3)

#### PDEContentFlags

Header: `PEExpT.h:1723`

A bit field for `PDEContentAttrs`.

**Values**

- `kPDESetCacheDevice = 0x0001`: If set, `cacheDevice` contains 6 cache device values.
- `kPDESetCharWidth = 0x0002`: If set, `cacheDevice` contains 2 charwidth values.
- `kPDEFormMatrix = 0x0004`: If set, `formMatrix` contains a valid matrix.

**See also:** [`PDEContentGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetAttrs), [`PDEContentToCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentToCosObj)

#### PDEContentGetResourceFlags

Header: `PEExpT.h:1705`

A bit field for `PDEContentAttrs`.

**Values**

- `kPDEGetFonts = 0`: Obtain font resources.
- `kPDEGetXObjects = 1`: Obtain Xobject resources.
- `kPDEGetColorSpaces = 2`: Obtain color space resources.

**See also:** [`PDEContentGetResources`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetResources)

#### PDEContentToCosObjFlags

Header: `PEExpT.h:1616`

A bit field for the PDEContentToCosObj() method, indicating the type of object to create and how it is created. To learn about color operators, see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 171. You can find this document on the web store of the International Standards Organization (ISO).

**Values**

- `kPDEContentToPage = 0x0001`: Create page contents.
- `kPDEContentToForm = 0x0002`: Create a form.
- `kPDEContentToCharProc = 0x0004`: Create charprocs.
- `kPDEContentRev1Compat = 0x0008`: Currently unused.
- `kPDEContentDoNotResolveForms = 0x0010`: Currently unused.
- `kPDEContentDoNotResolveType3 = 0x0020`: Currently unused.
- `kPDEContentEmitDefaultRGBAndGray = 0x0040`: Emit calibrated RGB and gray information using the PDF 1.0 compatible mechanism. In this case, generate rg and k page operators and place DefaultGray and DefaultRGB color space arrays in the Resources dictionary. See the Color Operators section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.6.8, page 171.
- `kPDEContentInheritState = 0x0080`
- `kPDEContentDoNotEmitBXEX = 0x0100`: Prevents the emission of the content compatibility operators, BX/EX, which cause issues for some versions of PDF/A or PDF/X.
- `kPDEContentUseMaxPrecision = 0x0200`: By default 3 digit precision after decimal point is used for floating
  point values. Using this flag increases precision from 3 digits to 5 digits after decimal point.
- `kPDEContentUseSpaceAsEOL = 0x0400`: Use a space character as the EOL character in the content stream to make the Flate compressor more effective.
- `kPDEContentHonorWasSetFlags = 0x0800`: Emit a gstate or textstate parameter for any element, only if the corresponding WasSetFlag is set.
- `kPDEContentSkipBBox = 0x1000`: Setting this flag will skip optimization of bounding box of form XObject.
- `kPDEContentSkipResReset = 0x2000`: Setting this flag will skip resetting of ResTable in PDEContent and it also skips creating new resource dictionary in document and uses resource dictionary from input.
- `kPDEContentFormFromPage = 0x20000`: Note that this form content was created from a page, and should never inherit any state from the calling code, nor allow any state to leak from the form

**See also:** [`PDEContentToCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentToCosObj)

## PDEDeviceNColors

### Functions (2)

#### PDEDeviceNColorsCreate

```cpp
PDEDeviceNColors PDEDeviceNColorsCreate(IN ASFixed *pColorValues, IN ASInt32 numValues)
```

Header: `PEWProcs.h:1452`

Creates an object that can be used to store `n` color components when in a DeviceN color space. Call PDERelease() to dispose of the returned PDEDeviceNColors object when finished with it.

**Parameters**

- `pColorValues` (`IN ASFixed *`): IN/OUT A pointer to an array of ASFixed values.
- `numValues` (`IN ASInt32`): IN/OUT The length of the array.

**Returns:** [`PDEDeviceNColors`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEDeviceNColors)

An object containing values specifying a color in a PDEDeviceNColors color space.

**Exceptions**

- `genErrNoMemory`

**See also:** [`PDEDeviceNColorsGetColorValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEDeviceNColorsGetColorValue)

#### PDEDeviceNColorsGetColorValue

```cpp
ASFixed PDEDeviceNColorsGetColorValue(IN PDEDeviceNColors colors, IN ASInt32 index)
```

Header: `PERProcs.h:1577`

Gets the value of a color component of a PDEDeviceNColors color space.

**Parameters**

- `colors` (`IN PDEDeviceNColors`): IN/OUT A PDEDeviceNColors object returned by PDEDeviceNColorsCreate().
- `index` (`IN ASInt32`): IN/OUT The index of the color component to return.

**Returns:** [`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)

The value of the requested color component.

**Exceptions**

- `genErrBadParm`

**See also:** [`PDEDeviceNColorsCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEDeviceNColorsCreate)

### Structures (1)

#### PDEDeviceNColors

```cpp
typedef struct _t_PDEDeviceNColors* PDEDeviceNColors
```

Header: `PEExpT.h:358`

A color space with a variable number of device-dependent components. It is usually used to store multiple spot colors in a single color space.

**See also:** [`PDEDeviceNColorsCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEDeviceNColorsCreate)

## PDEElement

### Functions (22)

#### PDEElementCopy

```cpp
PDEElement PDEElementCopy(IN PDEElement pdeElement, IN ASUns32 flags)
```

Header: `PEWProcs.h:225`

Makes a copy of an element. The caller is responsible for releasing the copy with PDERelease().

**Parameters**

- `pdeElement` (`IN PDEElement`): IN/OUT The element to copy.
- `flags` (`IN ASUns32`): IN/OUT A bit field of PDEElementCopyFlags.

**Returns:** [`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)

A copy of `pdeElement`.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEContentGetElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetElem)

#### PDEElementGetAllVisibilities

```cpp
ASUns32 PDEElementGetAllVisibilities(PDEElement elem, PDEContent content, PDOCContext ocContext, ASBool *visibilities, ASUns32 capacity)
```

Header: `PERProcs.h:2425`

Tests whether all occurrences of the element are visible in a given content and optional-content context. It traverses the content to find each occurrence of the element, in the supplied content and in all nested contents. To find the visibility of a content element without considering its parent, use PDEElementIsCurrentlyVisible(). It returns the number of occurrences and an array of boolean values containing `true` for each occurrence of the element that is visible in the context, taking into account the context's NonOCDrawing and PDOCDrawEnumType values.

**Parameters**

- `elem` ([`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)): The element for which to obtain visibilities.
- `content` ([`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent)): The content containing the element.
- `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The optional-content context in which the element is tested.
- `visibilities` ([`ASBool *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): (Filled by the method) An array of boolean values containing `true` for each occurrence of the element that is visible in the context.
- `capacity` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The size of the visibilities array.

**Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)

The number of occurrences of the element in the content.

**See also:** [`PDEElementIsCurrentlyVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsCurrentlyVisible), [`PDEElementMakeVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementMakeVisible)

#### PDEElementGetBBox

```cpp
void PDEElementGetBBox(IN PDEElement pdeElement, OUT ASFixedRectP bboxP)
```

Header: `PERProcs.h:197`

Gets the bounding box for an element. The returned bounding box is guaranteed to encompass the element, but is not guaranteed to be the smallest box that could contain the element. For example, for an arc, `bboxP` encloses the bezier control points, and not just the curve itself.

**Parameters**

- `pdeElement` (`IN PDEElement`): IN/OUT An element whose bounding box is obtained.
- `bboxP` (`OUT ASFixedRectP`): IN/OUT (Filled by the method) A pointer to a `ASFixedRect` structure specifying the bounding box of `pdeElement`, specified in user space coordinates.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`: @notify PDEElementGetClip @notify PDEElementGetGState @notify PDEElementGetMatrix

#### PDEElementGetClip

```cpp
PDEClip PDEElementGetClip(IN PDEElement pdeElement)
```

Header: `PERProcs.h:271`

Gets the current clip for an element. The current clipping path is part of the graphics state. Element types that are not graphics elements (for example, PDEContainer and PDEPlace) do not have an associated `gstate` and should not be expected to return valid results. **Note:** This method does not change the reference count of the clip object.

**Parameters**

- `pdeElement` (`IN PDEElement`): IN/OUT An element whose clip is obtained. Note that a clip may be shared by many elements. Use care when modifying a clip. Copy it first if you want to modify the clip for a specific element.

**Returns:** [`PDEClip`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClip)

The clip object for `pdeElement`.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEElementGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetBBox), [`PDEElementGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGState), [`PDEElementGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetMatrix), [`PDEElementIsAtRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsAtRect)

#### PDEElementGetGState

```cpp
void PDEElementGetGState(IN PDEElement pdeElement, OUT PDEGraphicStateP stateP, IN ASUns32 stateSize)
```

Header: `PERProcs.h:224`

Gets the graphics state information for an element. This method is only valid for PDEForm, PDEImage, PDEPath, and PDEShading elements.

**Parameters**

- `pdeElement` (`IN PDEElement`): An element whose graphics state is obtained.
- `stateP` (`OUT PDEGraphicStateP`): (Filled by the method) A pointer to a `PDEGraphicState` structure that contains graphics state information for `pdeElement`. This PDEGraphicStateP may contain PDEObjects for color spaces or an ExtGState. They are not acquired by this method. Note that for a PDEImage, only the ExtGState value is used for images. For indexed images, the fill color space and values are categorized in the PDEImage object.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEElementSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetGState), [`PDEElementGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetBBox), [`PDEElementGetClip`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetClip), [`PDEElementGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetMatrix), [`PDEElementGetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGStateEx)

#### PDEElementGetGStateEx

```cpp
void PDEElementGetGStateEx(IN PDEElement pdeElement, OUT PDEGraphicStateExP stateP, IN ASUns32 stateSize)
```

Header: `PERProcs.h:3231`

Gets the graphics state information for an element. This method fills PDEGraphicStateEx as output which is higher precision alternative of `PDEGraphicState` structure. This method is only valid for PDEForm, PDEImage, PDEPath, and PDEShading elements. @since

**Parameters**

- `pdeElement` (`IN PDEElement`): An element whose graphics state is obtained.
- `stateP` (`OUT PDEGraphicStateExP`): (Filled by the method) A pointer to a PDEGraphicStateEx
  structure that contains graphics state information for `pdeElement`.
  This PDEGraphicStateExP may contain PDEObjects for color spaces
  or an ExtGState. They are not acquired by this method. Note that
  for a PDEImage, only the ExtGState value is used for images.
  For indexed images, the fill color space and values are
  categorized in the PDEImage object.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEElementSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetGState), [`PDEElementGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetBBox), [`PDEElementGetClip`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetClip), [`PDEElementGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetMatrix), [`PDEElementGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGState), [`PDEElementSetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetGStateEx)

#### PDEElementGetMatrix

```cpp
void PDEElementGetMatrix(IN PDEElement pdeElement, OUT ASFixedMatrixP matrixP)
```

Header: `PERProcs.h:249`

Superseded by PDEElementGetMatrixEx() in Acrobat 10.0. Gets the transformation matrix for an element. This matrix provides the transformation from user space to device space for the element. If there is no cm (`concatmatrix`) operator in the page stream, the matrix is the identity matrix.

**Parameters**

- `pdeElement` (`IN PDEElement`): An element whose transformation matrix is obtained.
- `matrixP` (`OUT ASFixedMatrixP`): (Filled by the method) A pointer to `ASFixedMatrix` that holds a transformation matrix for `pdeElement`. If `pdeElement` is a text object, it returns the identity matrix.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEElementSetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetMatrix), [`PDEElementGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetBBox), [`PDEElementGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGState), [`PDEElementGetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetMatrixEx)

#### PDEElementGetMatrixEx

```cpp
void PDEElementGetMatrixEx(IN PDEElement pdeElement, OUT ASDoubleMatrixP matrixP)
```

Header: `PERProcs.h:3023`

Supersedes PDEElementGetMatrix() in Acrobat 10.0. Gets the transformation matrix for an element. This matrix provides the transformation from user space to device space for the element. If there is no cm (`concatmatrix`) operator in the page stream, the matrix is the identity matrix.

**Parameters**

- `pdeElement` (`IN PDEElement`): An element whose transformation matrix is obtained.
- `matrixP` (`OUT ASDoubleMatrixP`): (Filled by the method) A pointer to `ASDoubleMatrix` that holds a transformation matrix for `pdeElement`. If `pdeElement` is a text object, it returns the identity matrix.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEElementSetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetMatrixEx), [`PDEElementGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetBBox), [`PDEElementGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGState), [`PDEElementGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetMatrix)

#### PDEElementGetOCMD

```cpp
PDOCMD PDEElementGetOCMD(PDEElement elem)
```

Header: `PERProcs.h:2365`

Gets an optional-content membership dictionary (OCMD) object associated with the element. The element must be a PDEForm, PDEImage (XObject image), or PDEContainer. If it is not one of these, the method returns `NULL`. • If the element is a PDEForm or PDEImage, the method returns the dictionary attached to the element's Cos XObject dictionary. • If the element is a PDEContainer, and it is for optional content, the method returns the dictionary. If it is not for optional content, the method returns `NULL`.

**Parameters**

- `elem` ([`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)): The element from which the dictionary is obtained.

**Returns:** [`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD)

The dictionary object, or `NULL` if the element is not a PDEForm, PDEImage (XObject image), or PDEContainer, or if it is a container that is not for optional content.

**See also:** [`PDAnnotGetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetOCMD), [`PDEElementSetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetOCMD), [`PDEElementRemoveOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementRemoveOCMD), [`PDOCMDFindOrCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDFindOrCreate)

#### PDEElementHasGState

```cpp
ASBool PDEElementHasGState(IN PDEElement pdeElement, OUT PDEGraphicStateP stateP, IN ASUns32 stateSize)
```

Header: `PERProcs.h:2026`

Gets the graphics state information for an element.

**Parameters**

- `pdeElement` (`IN PDEElement`): The PDEElement whose graphics state is to be obtained.
- `stateP` (`OUT PDEGraphicStateP`): (Filled by the method) A pointer to a `PDEGraphicState` structure that contains graphics state information for `pdeElement`.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer. Set it to `sizeof(PDEGraphicState)`.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if the element has a graphics state, `false` otherwise.

**Exceptions**

- `genErrBadParm`

**See also:** [`PDEElementHasGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementHasGStateEx)

#### PDEElementHasGStateEx

```cpp
ASBool PDEElementHasGStateEx(IN PDEElement pdeElement, OUT PDEGraphicStateExP stateP, IN ASUns32 stateSize)
```

Header: `PERProcs.h:3252`

Gets the graphics state information for an element. This method fills PDEGraphicStateEx as output which is higher precision alternative of `PDEGraphicState` structure. @since

**Parameters**

- `pdeElement` (`IN PDEElement`): The PDEElement whose graphics state
  is to be obtained.
- `stateP` (`OUT PDEGraphicStateExP`): (Filled by the method) A pointer to a PDEGraphicStateEx
  structure that contains graphics state information for `pdeElement`.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer. Set it to `sizeof(PDEGraphicStateEx)`.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

**Exceptions**

- `genErrBadParm`

**See also:** [`PDEElementHasGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementHasGState)

#### PDEElementIsAtPoint

```cpp
ASBool PDEElementIsAtPoint(IN PDEElement elem, IN ASFixedPoint point)
```

Header: `PERProcs.h:1680`

Tests whether a point is on an element.

**Parameters**

- `elem` (`IN PDEElement`): IN/OUT The element to test. If PDEElement is a PDEText or PDEImage, it uses the bounding box of the PDEElement to make the check. If the PDEElement is a PDEPath and it is stroked, it checks if the point is on the path. If the PDEElement is a PDEPath and it is filled, it checks if the point is in the fill area, taking into consideration whether it is filled using the non-zero winding number rule or the even-odd rule.
- `point` (`IN ASFixedPoint`): IN/OUT The point, specified in user space coordinates.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if the point is on the element, `false` otherwise.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEElementIsAtRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsAtRect), [`PDETextIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtPoint), [`PDETextIsAtRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtRect)

#### PDEElementIsAtRect

```cpp
ASBool PDEElementIsAtRect(IN PDEElement elem, IN ASFixedRect rect)
```

Header: `PERProcs.h:1704`

Tests whether any part of a rectangle is on an element.

**Parameters**

- `elem` (`IN PDEElement`): IN/OUT The element to test. If PDEElement is a PDEText or PDEImage, it uses the bounding box of the PDEElement to make the check. If the PDEElement is a PDEPath and it is stroked, it checks if the rectangle is on the path. If the PDEElement is a PDEPath and it is filled, it checks if the rectangle is in the fill area, taking into consideration whether it is filled using the non-zero winding number rule or the even-odd rule.
- `rect` (`IN ASFixedRect`): IN/OUT The rectangle, specified in user space coordinates.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if any part of the rectangle is on the element, `false` otherwise.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEElementIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsAtPoint), [`PDETextIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtPoint), [`PDETextIsAtRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtRect)

#### PDEElementIsCurrentlyVisible

```cpp
ASBool PDEElementIsCurrentlyVisible(PDEElement elem, PDEContent content, PDOCContext ocContext)
```

Header: `PERProcs.h:2395`

Tests whether an element is visible in a given content and optional-content context. It traverses the content to find the first occurrence of the element, in the supplied content and in all nested contents. It returns `true` if the first occurrence of the element is visible in the context, taking into account the context's NonOCDrawing and PDOCDrawEnumType values. The content can be `NULL`. In this case: • If the element is a PDEForm, PDEImage, or PDEContainer, the method checks the object to see if it has an optional-content membership dictionary (OCMD) attached to it. If so, the method returns `true` if the object is visible, without considering whether the PDEContent that the element belongs to is visible. • If the element is not one of these types, the method returns `true`.

**Parameters**

- `elem` ([`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)): The element to test.
- `content` ([`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent)): The content containing the element.
- `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The optional-content context in which the element is tested.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

Returns `true` if the element is visible in the given content and context, `false` if it is hidden.

**See also:** [`PDEElementGetAllVisibilities`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetAllVisibilities), [`PDEElementMakeVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementMakeVisible)

#### PDEElementMakeVisible

```cpp
ASBool PDEElementMakeVisible(PDEElement elem, PDEContent content, PDOCContext ocContext)
```

Header: `PERProcs.h:2443`

Makes an element visible in a given content and optional-content context, by manipulating the `ON-OFF` states of the optional-content groups.

**Parameters**

- `elem` ([`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)): The element for which to set the visibility state.
- `content` ([`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent)): The content containing the element.
- `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The optional-content context in which the element is made visible.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if the element is successfully made visible in the given content and context, `false` otherwise.

**See also:** [`PDEElementGetAllVisibilities`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetAllVisibilities), [`PDEElementIsCurrentlyVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsCurrentlyVisible), [`PDOCMDsMakeContentVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDsMakeContentVisible)

#### PDEElementRemoveOCMD

```cpp
void PDEElementRemoveOCMD(PDEElement elem)
```

Header: `PEWProcs.h:2321`

Dissociates an optional-content membership dictionary (OCMD) object from the element. The element must be a PDEForm, a PDEImage (XObject image), or a PDEContainer. If it is not one of these, nothing happens: • If the element is a PDEForm or PDEImage, the method removes the dictionary from the element's Cos XObject dictionary. • If the element is a PDEContainer for optional content, the method removes the dictionary, but does not destroy the container.

**Parameters**

- `elem` ([`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)): The element for which to remove the dictionary.

**Returns:** `void`

**See also:** [`PDEElementGetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetOCMD), [`PDEElementSetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetOCMD), [`PDOCMDFindOrCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDFindOrCreate)

#### PDEElementSetClip

```cpp
void PDEElementSetClip(IN PDEElement pdeElement, IN PDEClip pdeClip)
```

Header: `PEWProcs.h:211`

Sets the current clip for an element. The `pdeElement` parameter's previous clip's reference count is decremented (if it had one), and the `pdeClip` parameter's reference count is incremented.

**Parameters**

- `pdeElement` (`IN PDEElement`): IN/OUT An element whose clip is set.
- `pdeClip` (`IN PDEClip`): IN/OUT The clip to set for `pdeContent`.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEElementGetClip`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetClip)

#### PDEElementSetGState

```cpp
void PDEElementSetGState(IN PDEElement pdeElement, IN PDEGraphicStateP stateP, IN ASUns32 stateSize)
```

Header: `PEWProcs.h:174`

Sets the graphics state information for an element. This method is valid only for PDEForm, PDEImage, PDEPath, and PDEShading elements. **Note:** This method causes any of the `stateP` parameter's color space or ExtGState objects to have their reference count incremented, and previous graphic state objects to be decremented.

**Parameters**

- `pdeElement` (`IN PDEElement`): An element whose graphics state is set.
- `stateP` (`IN PDEGraphicStateP`): A pointer to a `PDEGraphicState` structure with graphics state information to set for `pdeContent`. Any of the `stateP` parameter's color space or ExtGState objects have their reference count incremented.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`: will be raised if the first parameter, `pdeElement`, does not have a graphics state associated with it.

**See also:** [`PDEElementGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGState), [`PDEElementSetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetGStateEx)

#### PDEElementSetGStateEx

```cpp
void PDEElementSetGStateEx(IN PDEElement pdeElement, IN PDEGraphicStateExP stateP, IN ASUns32 stateSize)
```

Header: `PEWProcs.h:3762`

Sets the graphics state information for an element. This method takes pointer to PDEGraphicStateEx as input which is higher precision alternative of `PDEGraphicState` structure. This method is valid only for PDEForm, PDEImage, PDEPath, and PDEShading elements. @note This method causes any of the `stateP` parameter's color space or ExtGState objects to have their reference count incremented, and previous graphic state objects to be decremented. @since

**Parameters**

- `pdeElement` (`IN PDEElement`): An element whose graphics state is set.
- `stateP` (`IN PDEGraphicStateExP`): A pointer to a PDEGraphicStateEx structure
  with graphics state information to set for `pdeContent`. Any
  of the `stateP` parameter's color space or ExtGState objects have their
  reference count incremented.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`: will be raised if the first parameter, `pdeElement`,
  does not have a graphics state associated with it.

**See also:** [`PDEElementGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGState), [`PDEElementGetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGStateEx), [`PDEElementSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetGState)

#### PDEElementSetMatrix

```cpp
void PDEElementSetMatrix(IN PDEElement pdeElement, IN ASFixedMatrixP matrixP)
```

Header: `PEWProcs.h:195`

Superseded by PDEElementSetMatrixEx() in Acrobat 10.0. Sets the transformation matrix for an element. The element may not be a PDEContainer, a PDEGroup, a PDEPlace, or a PDEText.

**Parameters**

- `pdeElement` (`IN PDEElement`): IN/OUT An element whose transformation matrix is set.
- `matrixP` (`IN ASFixedMatrixP`): IN/OUT A pointer to an `ASFixedMatrix` that holds the transformation matrix to set for `pdeContent`.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEElementGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetMatrix), [`PDEElementSetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetMatrixEx)

#### PDEElementSetMatrixEx

```cpp
void PDEElementSetMatrixEx(IN PDEElement pdeElement, IN ASDoubleMatrixP matrixP)
```

Header: `PEWProcs.h:3659`

Sets the transformation matrix for an element. Supersedes PDEElementSetMatrix() in Acrobat 10.0. The element may not be a PDEContainer, a PDEGroup, a PDEPlace, or a PDEText.

**Parameters**

- `pdeElement` (`IN PDEElement`): IN/OUT An element whose transformation matrix is set.
- `matrixP` (`IN ASDoubleMatrixP`): IN/OUT A pointer to an `ASDoubleMatrix` that holds the transformation matrix to set for `pdeContent`.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEElementGetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetMatrixEx), [`PDEElementSetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetMatrix)

#### PDEElementSetOCMD

```cpp
void PDEElementSetOCMD(PDEElement elem, PDOCMD pdOCMD)
```

Header: `PEWProcs.h:2298`

Associates an optional-content membership dictionary (OCMD) object with the element. The element must be a PDEForm, a PDEImage (XObject image), or a PDEContainer. If it is not one of these, nothing happens: • If the element is a PDEForm or PDEImage, the method attaches the dictionary to the element's Cos XObject dictionary. • If the element is a PDEContainer, and it is already for optional content, the optional-content information is replaced. • If it is not already for optional content, a new PDEContainer for optional content is created and nested inside the specified container.

**Parameters**

- `elem` ([`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)): The element for which to set the dictionary.
- `pdOCMD` ([`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD)): The new dictionary.

**Returns:** `void`

**See also:** [`PDEElementGetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetOCMD), [`PDEElementRemoveOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementRemoveOCMD), [`PDOCMDFindOrCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDFindOrCreate)

### Typedefs (1)

#### PDEElementEnumProc

```cpp
typedef ASBool(*) PDEElementEnumProc(IN PDEElement elem, IN void *clientData)(IN PDEElement elem, IN void *clientData)
```

Header: `PEExpT.h:2092`

A callback for PDEEnumElements(). It is called once for each PDEElement in a page's Contents Stream or Resources dictionary.

**See also:** [`PDEEnumElements`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEEnumElements)

### Structures (1)

#### PDEElement

```cpp
typedef struct _t_PDEElement* PDEElement
```

Header: `PEExpT.h:143`

The base class for elements of a page display list (PDEContent) and for clip objects. The general PDEElement methods allow you to get and set general element properties.

**See also:** `PDEContainer (subclass)`, `PDEForm (subclass)`, `PDEGroup (subclass)`, `PDEImage (subclass)`, `PDEPath (subclass)`, `PDEPlace (subclass)`, `PDEPS (subclass)`, `PDEShading (subclass)`, `PDEText (subclass)`, `PDEUnknown (subclass)`, `PDEXObject (subclass)`, `PDEClipGetElem (subclass)`, `PDEContentGetElem (subclass)`, `PDEElementCopy (subclass)`, [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

### Enums (1)

#### PDEElementCopyFlags

Header: `PEExpT.h:1937`

A bit field for `PDEElementCopy()`.

**Values**

- `kPDEElementCopyForClip = 0x0001`: The copied element does not need `gstate` or `clip`.
- `kPDEElementCopyClipping = 0x0002`: Acquire the clip path and put it in the copied object.

**See also:** [`PDEElementCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementCopy)

## PDEElements

### Functions (1)

#### PDEEnumElements

```cpp
void PDEEnumElements(IN const CosObj *contents, IN const CosObj *resources, IN ASUns32 flags, IN PDEElementEnumProc enumProc, IN void *enumProcClientData)
```

Header: `PERProcs.h:1519`

Enumerates all the PDEElements in a given stream. It is similar to PDEContentCreateFromCosObj(), but provides enumeration instead of a list of elements. If marked content is not ignored, each PDEContainer contains a PDEContent list within itself.

**Parameters**

- `contents` (`IN const CosObj *`): IN/OUT A Cos object that is the source for the content stream. It may be page contents, a Form XObject, a Type 3 font CharProc, or an appearance object from an annotation.
- `resources` (`IN const CosObj *`): IN/OUT The object's Resources dictionary. If the Form or Type 3 font or appearance dictionary contains a Resources dictionary, this dictionary must be passed in `resources`. Otherwise, it must be the page resources object of the page containing the Form or Type 3 font contents object.
- `flags` (`IN ASUns32`): IN/OUT Flags from PDEEnumElementsFlags.
- `enumProc` (`IN PDEElementEnumProc`): IN/OUT A user-supplied callback to call once for each top-level element. Note that the element in `enumProc` may only be valid for this method. Use PDEAcquire() if you need to hold on to the element longer than the scope of `enumProc`.
- `enumProcClientData` (`IN void *`): IN/OUT A pointer to user-supplied data to pass to `enumProc` each time it is called.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `peErrPStackUnderflow`
- `peErrCantGetImageDict`

**See also:** [`PDEContentCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentCreateFromCosObj), [`PDEContentGetNumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetNumElems), [`PDEContentGetElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetElem)

## PDEEndContainer

### Functions (1)

#### PDEEndContainerCreate

```cpp
PDEEndContainer PDEEndContainerCreate()
```

Header: `PEWProcs.h:1988`

Creates a new PDEEndContainer object. Call PDERelease to dispose of the returned PDEEndContainer object when finished with it. Call PDERelease() to dispose of the returned PDEEndContainer object when finished with it.

**Returns:** [`PDEEndContainer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEEndContainer)

The newly created object.

### Structures (1)

#### PDEEndContainer

```cpp
typedef struct _t_PDEEndContainer* PDEEndContainer
```

Header: `PEExpT.h:281`

The PDFEdit representation of the closing bracket of a marked-content sequence. Elements of this type must be paired with elements of type PDEBeginContainer.

**See also:** `PDEElement (superclass)`, [`PDEEndContainerCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEEndContainerCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

## PDEEndGroup

### Functions (1)

#### PDEEndGroupCreate

```cpp
PDEEndGroup PDEEndGroupCreate()
```

Header: `PEWProcs.h:2006`

Creates a new end group object. Call PDERelease() to dispose of the returned PDEEndGroup object when finished with it.

**Returns:** [`PDEEndGroup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEEndGroup)

The newly created object.

### Structures (1)

#### PDEEndGroup

```cpp
typedef struct _t_PDEEndGroup* PDEEndGroup
```

Header: `PEExpT.h:295`

A group of PDEElement objects on a page in a PDF file.

**See also:** `PDEElement (superclass)`, [`PDEEndGroupCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEEndGroupCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

## PDEExtGState

### Functions (30)

#### PDEExtGStateAcquireSoftMask

```cpp
PDESoftMask PDEExtGStateAcquireSoftMask(IN PDEExtGState pdeExtGState)
```

Header: `PERProcs.h:2172`

Acquires the soft mask of the extended graphic state. Call PDERelease() to dispose of the PDESoftMask when finished with it.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): The extended graphics state object.

**Returns:** [`PDESoftMask`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMask)

The soft mask or `NULL` if the ExtGState dictionary does not contain the SMask key.

**Exceptions**

- `peErrWrongPDEObjectType`: if pdeExtGState is `NULL` or is not of type
- `kPDEExtGState.`

#### PDEExtGStateCreate

```cpp
PDEExtGState PDEExtGStateCreate(IN CosObj *cosObjP)
```

Header: `PEWProcs.h:1097`

Creates a new PDEExtGState from a Cos object. See the description of Extended Graphic States in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.4.5, page 128. You can find this document on the web store of the International Standards Organization (ISO). Call PDERelease() to dispose of the returned PDEExtGState when finished with it.

**Parameters**

- `cosObjP` (`IN CosObj *`): A Cos object for a dictionary of type ExtGState.

**Returns:** [`PDEExtGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGState)

The PDEExtGState for `cosObjP`.

**See also:** [`PDEElementSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetGState), [`PDEExtGStateGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateGetCosObj)

#### PDEExtGStateCreateNew

```cpp
PDEExtGState PDEExtGStateCreateNew(IN CosDoc cosDoc)
```

Header: `PEWProcs.h:1829`

Creates a new extended graphics state object. Call PDERelease() to dispose of the returned PDEExtGState object when finished with it.

**Parameters**

- `cosDoc` (`IN CosDoc`): IN/OUT The document within which the object will be used.

**Returns:** [`PDEExtGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGState)

The newly created object.

#### PDEExtGStateGetAIS

```cpp
ASBool PDEExtGStateGetAIS(IN PDEExtGState pdeExtGState)
```

Header: `PERProcs.h:2146`

Returns the value of the Alpha Is Shape (AIS) member of the graphics state. If AIS is `true`, the sources of alpha are treated as shape; otherwise they are treated as opacity values. If the value is not set, the default value of `false` is returned.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

See above.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEExtGStateGetBPC

```cpp
ASAtom PDEExtGStateGetBPC(IN PDEExtGState extGS)
```

Header: `PERProcs.h:3342`

Returns the value of black point compensation. Valid names are ON, OFF and Default. If the value has not been set a value of Default is returned.

**Parameters**

- `extGS` (`IN PDEExtGState`): The extended graphics state object.

**Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)

`ASAtom` for BPC value.

**Exceptions**

- `genErrBadParm`

**See also:** [`PDEExtGStateSetBPC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateSetBPC)

#### PDEExtGStateGetBlendMode

```cpp
ASAtom PDEExtGStateGetBlendMode(IN PDEExtGState pdeExtGState)
```

Header: `PERProcs.h:2131`

Returns the blend mode for the color composite for each object painted. The following are valid names: • Compatible • Normal • Multiply • Screen • Difference • Darken • Lighten • ColorDodge • ColorBurn • Exclusion • HardLight • Overlay • SoftLight • Luminosity • Hue • Saturation • Color

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.

**Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)

If the value has not been set, a value of Compatible is returned. See above.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEExtGStateGetCosObj

```cpp
void PDEExtGStateGetCosObj(IN PDEExtGState extGState, OUT CosObj *cosObjP)
```

Header: `PERProcs.h:1320`

Gets a Cos object for a PDEExtGState.

**Parameters**

- `extGState` (`IN PDEExtGState`): IN/OUT A PDEExtGState whose Cos object is obtained.
- `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for `extGState`.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEExtGStateCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateCreate)

#### PDEExtGStateGetHalfToneOrigin

```cpp
ASRealPoint PDEExtGStateGetHalfToneOrigin(IN PDEExtGState extGS)
```

Header: `PERProcs.h:3200`

Returns HalfTone Co-ordinate point.

**Parameters**

- `extGS` (`IN PDEExtGState`): The extended graphics state object.

**Returns:** `ASRealPoint`

`ASRealPoint*` for x,y coordinate value of HalfToneOrigin.

**Exceptions**

- `genErrBadParm`

**See also:** [`PDEExtGStateGetHalfToneOrigin`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateGetHalfToneOrigin)

#### PDEExtGStateGetOPFill

```cpp
ASBool PDEExtGStateGetOPFill(IN PDEExtGState pdeExtGState)
```

Header: `PERProcs.h:2056`

Returns whether overprint is enabled for painting operations other than stroking.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

Returns the value of the / op key in the ExtGState dictionary. If the value is not found, the default value of `false` is returned.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEExtGStateGetOPM

```cpp
ASInt32 PDEExtGStateGetOPM(IN PDEExtGState pdeExtGState)
```

Header: `PERProcs.h:2042`

Returns the overprint mode used by this graphics state.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The Cos integer value.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEExtGStateGetOPStroke

```cpp
ASBool PDEExtGStateGetOPStroke(IN PDEExtGState pdeExtGState)
```

Header: `PERProcs.h:2070`

Returns whether overprint is enabled for stroke painting operations.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

Returns the value of the / OP key in the ExtGState dictionary. If the value is not found, the default value of `false` is returned.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEExtGStateGetOpacityFill

```cpp
ASFixed PDEExtGStateGetOpacityFill(IN PDEExtGState pdeExtGState)
```

Header: `PERProcs.h:2084`

Returns the opacity value for painting operations other than stroking.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.

**Returns:** [`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)

Returns the value of the / ca key in the ExtGState dictionary. If the value is not found, the default value of `1` is returned.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEExtGStateGetOpacityStroke

```cpp
ASFixed PDEExtGStateGetOpacityStroke(IN PDEExtGState pdeExtGState)
```

Header: `PERProcs.h:2098`

Returns the opacity value for stroke painting operations for paths and glyph outlines.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.

**Returns:** [`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)

Returns the value of the / CA key in the ExtGState dictionary. If the value is not found, the default value of `1` is returned.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEExtGStateGetSA

```cpp
ASBool PDEExtGStateGetSA(IN PDEExtGState pdeExtGState)
```

Header: `PERProcs.h:2296`

Returns whether stroke adjustment is enabled in the graphics state.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

Returns the value of the / SA key in the ExtGState dictionary. If the value is not set, the default value of `false` is returned.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEExtGStateGetSoftMaskMatrix

```cpp
ASBool PDEExtGStateGetSoftMaskMatrix(IN PDEExtGState extGS, OUT ASDoubleMatrixP matrixP)
```

Header: `PERProcs.h:3449`

Gets the softmask matrix from ExtGstate.

**Parameters**

- `extGS` (`IN PDEExtGState`): IN A ExtGstate object.
- `matrixP` (`OUT ASDoubleMatrixP`): OUT A pointer to ASDoubleMatrix

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

**See also:** [`PDEExtGStateSetSoftMaskMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateSetSoftMaskMatrix)

#### PDEExtGStateGetTK

```cpp
ASBool PDEExtGStateGetTK(IN PDEExtGState pdeExtGState)
```

Header: `PERProcs.h:2250`

Returns whether text knockout is enabled in the graphics state.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

Returns the value of the / TK key in the ExtGState dictionary. If the value is not found, the default value of `true` is returned.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEExtGStateHasSoftMask

```cpp
ASBool PDEExtGStateHasSoftMask(IN PDEExtGState pdeExtGState)
```

Header: `PERProcs.h:2159`

Returns whether the graphics state contains a soft mask.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

Returns `true` if the ExtGState dictionary contains the / SMask key; otherwise `false` is returned.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEExtGStateSetAIS

```cpp
void PDEExtGStateSetAIS(IN PDEExtGState pdeExtGState, IN ASBool alphaIsShape)
```

Header: `PEWProcs.h:1944`

Specifies if the alpha is to be interpreted as a shape or opacity mask.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): The extended graphics state object.
- `alphaIsShape` (`IN ASBool`): Indicates whether the sources of alpha are to be treated as shape (`true`) or opacity (`false`). This determines the interpretation of the constant alpha (ca or CA) and soft mask (SMask) parameters of the graphics state, as well as a soft-mask image (Smask entry) of an image XObject.

**Returns:** `void`

#### PDEExtGStateSetBPC

```cpp
void PDEExtGStateSetBPC(IN PDEExtGState extGS, IN ASAtom BPC)
```

Header: `PEWProcs.h:3820`

Sets the black point compensation. Valid names are ON, OFF and Default. An exception will be raised if the name is invalid.

**Parameters**

- `extGS` (`IN PDEExtGState`): The extended graphics state object.
- `BPC` (`IN ASAtom`): New value for BPC

**Returns:** `void`

**Exceptions**

- `genErrBadParm`

**See also:** [`PDEExtGStateGetBPC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateGetBPC)

#### PDEExtGStateSetBlendMode

```cpp
void PDEExtGStateSetBlendMode(IN PDEExtGState pdeExtGState, IN ASAtom blendMode)
```

Header: `PEWProcs.h:1929`

Sets the blend mode for the color composites for each object painted. The following mode names are valid: • Compatible • Normal • Multiply • Screen • Difference • Darken • Lighten • ColorDodge • ColorBurn • Exclusion • HardLight • Overlay • SoftLight • Luminosity • Hue • Saturation • Color

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.
- `blendMode` (`IN ASAtom`): IN/OUT The new blend mode.

**Returns:** `void`

#### PDEExtGStateSetHalfToneOrigin

```cpp
void PDEExtGStateSetHalfToneOrigin(IN PDEExtGState extGS, IN ASRealPoint hto_point)
```

Header: `PEWProcs.h:3731`

Sets HalfTone Co-ordinate point.

**Parameters**

- `extGS` (`IN PDEExtGState`): The extended graphics state object.
- `hto_point` (`IN ASRealPoint`)

**Returns:** `void`

**Exceptions**

- `genErrBadParm`

**See also:** [`PDEExtGStateSetHalfToneOrigin`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateSetHalfToneOrigin)

#### PDEExtGStateSetOPFill

```cpp
void PDEExtGStateSetOPFill(IN PDEExtGState pdeExtGState, IN ASBool overprint)
```

Header: `PEWProcs.h:1853`

Specifies if overprint is enabled for painting operations other than stroking. It corresponds to the / op key within the ExtGState's dictionary.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.
- `overprint` (`IN ASBool`): IN/OUT Pass `true` to enable overprint, `false` to disable overprint.

**Returns:** `void`

#### PDEExtGStateSetOPM

```cpp
void PDEExtGStateSetOPM(IN PDEExtGState pdeExtGState, IN ASInt32 opm)
```

Header: `PEWProcs.h:1840`

Sets the overprint mode. It corresponds to the / OPM key within the ExtGState's dictionary.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.
- `opm` (`IN ASInt32`): IN/OUT Overprint mode.

**Returns:** `void`

#### PDEExtGStateSetOPStroke

```cpp
void PDEExtGStateSetOPStroke(IN PDEExtGState pdeExtGState, IN ASBool overprint)
```

Header: `PEWProcs.h:1866`

Specifies if overprint is enabled for stroke operations. It corresponds to the / OP key within the ExtGState's dictionary.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.
- `overprint` (`IN ASBool`): IN/OUT Pass `true` to enable overprint, `false` to disable overprint.

**Returns:** `void`

#### PDEExtGStateSetOpacityFill

```cpp
void PDEExtGStateSetOpacityFill(IN PDEExtGState pdeExtGState, IN ASFixed opacity)
```

Header: `PEWProcs.h:1881`

Sets the opacity value for painting operations other than stroking. The value must be in the range from `0` to `1` inclusive. It corresponds to the / ca key within the ExtGState's dictionary. The value from `0` to `1` refers to a float number (not an ASFixed value) that should be converted to ASFixed using FloatToASFixed().

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.
- `opacity` (`IN ASFixed`): IN/OUT The new opacity value.

**Returns:** `void`

#### PDEExtGStateSetOpacityStroke

```cpp
void PDEExtGStateSetOpacityStroke(IN PDEExtGState pdeExtGState, IN ASFixed opacity)
```

Header: `PEWProcs.h:1896`

Sets the opacity value for stroke operations. The value must be in the range from `0` to `1` inclusive. It corresponds to the / CA key within the ExtGState's dictionary. The value from `0` to `1` refers to a float number (not an ASFixed value) that should be converted to ASFixed using FloatToASFixed().

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.
- `opacity` (`IN ASFixed`): IN/OUT The new opacity value.

**Returns:** `void`

#### PDEExtGStateSetSA

```cpp
void PDEExtGStateSetSA(IN PDEExtGState pdeExtGState, IN ASBool strokeAdjust)
```

Header: `PEWProcs.h:2240`

Specifies whether stroke adjustment is enabled in the graphics state.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.
- `strokeAdjust` (`IN ASBool`): IN/OUT Pass `true` to enable stroke adjustment, `false` to disable stroke adjustment.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEExtGStateSetSoftMask

```cpp
void PDEExtGStateSetSoftMask(IN PDEExtGState pdeExtGState, IN PDESoftMask pdeSoftMask)
```

Header: `PEWProcs.h:1954`

Sets the soft mask of the extended graphics state.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.
- `pdeSoftMask` (`IN PDESoftMask`): IN/OUT The soft mask object.

**Returns:** `void`

#### PDEExtGStateSetSoftMaskMatrix

```cpp
void PDEExtGStateSetSoftMaskMatrix(IN PDEExtGState extGS, IN ASDoubleMatrixP matrixP)
```

Header: `PEWProcs.h:3857`

Sets the softmask matrix in ExtGstate.

**Parameters**

- `extGS` (`IN PDEExtGState`): IN A ExtGstate object.
- `matrixP` (`IN ASDoubleMatrixP`): IN A pointer to `ASDoubleMatrix`

**Returns:** `void`

**See also:** [`PDEExtGStateGetSoftMaskMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateGetSoftMaskMatrix)

#### PDEExtGStateSetTK

```cpp
void PDEExtGStateSetTK(IN PDEExtGState pdeExtGState, IN ASBool bk)
```

Header: `PEWProcs.h:2052`

Specifies whether text knockout is enabled in the graphics state. This corresponds to the / TK key in the ExtGState's dictionary.

**Parameters**

- `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object.
- `bk` (`IN ASBool`): IN/OUT Pass `true` to enable text knockout, `false` to disable text knockout.

**Returns:** `void`

### Structures (1)

#### PDEExtGState

```cpp
typedef struct _t_PDEExtGState* PDEExtGState
```

Header: `PEExpT.h:345`

A reference to an ExtGState resource used on a page in a PDF file. It specifies a PDEElement object's extended graphics state, which is part of its graphics state.

**See also:** [`PDEExtGStateCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

## PDEFont

### Functions (34)

#### PDEFontAddGlyphs

```cpp
PDESpanSetP PDEFontAddGlyphs(IN PDEFont pdeFont, IN PDEGlyphRunP glyphRun, IN ASUns32 flags)
```

Header: `PEWProcs.h:2684`

Adds glyphs to a PDEFont object for embedding a PDEFont. This is used by clients that use PDEFEdit calls to embed the font but create their own content stream. The glyphs added by this routine will be included in the font when PDEFontSubsetNow() is called. It is up to the client to ensure that the encoding used by the PDEFont matches the character codes used in the string arguments to the text operators in the content stream. This routine is used to specify which glyphs should be included in the font when embedded. Additionally, it specifies the mapping from the GlyphIDs to Unicode values. This mapping will be used to create the ToUnicode entry in the embedded font object. In the cases where the ToUnicode table cannot accurately reproduce the Unicode string in the `PDEGlyphRun` structure, this routine will return an array of spans that describe the contents of the ActualText spans that must be included in the content stream. Each span indicates a contiguous range of glyphs and a corresponding contiguous range of Unicode values that correspond to the glyphs. For example, the following ActualText span replace two glyphs with three Unicode values. `/Span<</ActualText(U+vvvvU+xxxU+yyyy)>>` `BDC [Giii Gjjj] TJ EMC` Note that the routine must be called with the PDEGlyphRuns in display order.

**Parameters**

- `pdeFont` (`IN PDEFont`): The font for the element.
- `glyphRun` (`IN PDEGlyphRunP`): A pointer to a `PDEGlyphRun` structure with Unicode data, GlyphIDs and their correspondence. Note that the `xPosition` and `yPosition` fields in the `PDEGlyphDescription` structure are ignored.
- `flags` (`IN ASUns32`): Unused, reserved for later use.

**Returns:** `PDESpanSetP`

A pointer to a `PDESpanSet`. The span can be released with PDEReleaseSpan().

**Exceptions**

- `genErrBadParm`

**See also:** [`PDEFontSubsetNow`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontSubsetNow), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEReleaseSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEReleaseSpan)

#### PDEFontCreate

```cpp
PDEFont PDEFontCreate(IN PDEFontAttrsP attrsP, IN ASUns32 attrsSize, IN ASInt32 firstChar, IN ASInt32 lastChar, IN ASInt16 *widthsP, IN char **encoding, IN ASAtom encodingBaseName, IN ASStm fontStm, IN ASInt32 len1, IN ASInt32 len2, IN ASInt32 len3)
```

Header: `PEWProcs.h:839`

Creates a new PDEFont from the specified parameters. The PDEFont may be represented as an embedded font (a FontFile entry in the font descriptor of the PDF file). To create a PDEFont that is stored as an embedded font, the FontFile stream may be passed in `fontStm`, and the `len1`, `len2`, and `len3` parameters contain the Length1, Length2, and Length3 values of the FontFile stream attributes dictionary. See the description of Embedded Font Programs in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.9, page 288. You can find this document on the web store of the International Standards Organization (ISO). The caller must close `fontStm` with ASStmClose() after invoking PDEFontCreate(). Call PDERelease() to dispose of the returned font object when finished with it.

**Parameters**

- `attrsP` (`IN PDEFontAttrsP`): A pointer to a PDEFontAttrs structure for
  the font attributes.`attrsP` buffer in bytes.
- `attrsSize` (`IN ASUns32`)
- `firstChar` (`IN ASInt32`): The first character index for the widths
  array, `widthsP`.
- `lastChar` (`IN ASInt32`): The last character index for the widths array,
  `widthsP`.
- `widthsP` (`IN ASInt16 *`): A pointer to the widths array.
- `encoding` (`IN char **`): An array of 256 pointers to glyph names
  specifying the custom encoding. If any pointer is `NULL`,
  no encoding information is written for that entry.
- `encodingBaseName` (`IN ASAtom`): The encoding base name if the encoding
  is a custom encoding. If the encoding is `NULL`, `encodingBaseName`
  is used as the value of the encoding, and must be one of
  `WinAnsiEncoding`, `MacRomanEncoding`, or
  `MacExpertEncoding`. If no encoding value is desired, use ASAtomNull.
- `fontStm` (`IN ASStm`): The stream with font information.
- `len1` (`IN ASInt32`): The length in bytes of the ASCII portion of the Type 1 font file after it has been decoded. For other font formats, such as TrueType or CFF, only `len1` is used, and it is the size of the font.
- `len2` (`IN ASInt32`): The length in bytes of the encrypted portion of the Type 1 font file after it has been decoded.
- `len3` (`IN ASInt32`): The length in bytes of the portion of the Type 1 font file that contains the 512 zeros, plus the `cleartomark` operator, plus any following data.

**Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)

The specified PDEFont.

**Exceptions**

- `peErrCantCreateFontSubset`
- `peErrCantGetAttrs`
- `peErrCantGetWidths`
- `peErrCantEmbedFont`
- `genErrResourceLoadFailed`

**See also:** [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontEx), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), [`PDEFontCreateWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateWithParams)

#### PDEFontCreateFromCosObj

```cpp
PDEFont PDEFontCreateFromCosObj(const CosObj *cosObjP)
```

Header: `PEWProcs.h:867`

Creates a PDEFont corresponding to a Cos object of type Font. Call PDERelease() to dispose of the returned font object when finished with it.

**Parameters**

- `cosObjP` ([`const CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The Cos object for which a PDEFont is created.

**Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)

The PDEFont created from cosObjP.

**Exceptions**

- `peErrCantCreateFontSubset`
- `peErrCantGetAttrs`
- `peErrCantGetWidths`
- `peErrCantEmbedFont`
- `genErrBadParm`
- `genErrResourceLoadFailed`

**See also:** [`PDEFontCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreate), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), [`PDEFontCreateWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateWithParams), [`PDEFontGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetCosObj)

#### PDEFontCreateFromSysFont

```cpp
PDEFont PDEFontCreateFromSysFont(IN PDSysFont sysFont, IN ASUns32 flags)
```

Header: `PEWProcs.h:905`

Gets a PDEFont corresponding to a font in the system. Call PDERelease() to dispose of the returned font object when finished with it. The PDEFontCreateFlags flags kPDEFontCreateEmbedded and kPDEFontWillSubset must both be set in order to subset a font. If you create a PDEFont that is a subset, call PDEFontSubsetNow() on this font afterwards. **Note:** If you want to use `WinAnsiEncoding` on UNIX, do not use this method. Use PDEFontCreateFromSysFontWithParams() or PDEFontCreateFromSysFontAndEncoding() instead.

**Parameters**

- `sysFont` (`IN PDSysFont`): A PDSysFont object referencing a system font.
- `flags` (`IN ASUns32`): Indicates whether to embed the font and whether to subset the font. It must be one of PDEFontCreateFlags. If you want to subset a font, set both the kPDEFontCreateEmbedded and kPDEFontWillSubset flags.

**Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)

The PDEFont corresponding to sysFont.

**Exceptions**

- `peErrCantCreateFontSubset`
- `peErrCantGetAttrs`
- `peErrCantGetWidths`
- `peErrCantEmbedFont`
- `genErrBadParm`
- `genErrResourceLoadFailed`

**See also:** [`PDEFontCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreate), [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFontAndEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontAndEncoding), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), [`PDEnumSysFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEnumSysFonts)

#### PDEFontCreateFromSysFontAndEncoding

```cpp
PDEFont PDEFontCreateFromSysFontAndEncoding(IN PDSysFont sysFont, IN PDSysEncoding sysEnc, IN ASAtom useThisBaseFont, IN ASUns32 createFlags)
```

Header: `PEWProcs.h:2160`

Create a PDEFont from `sysFont` and `sysEnc`. If it fails, it raises an exception. User can call PDSysFontGetCreateFlags() to see if the combination of sysFont and sysEnc makes sense. Call PDERelease() to dispose of the returned PDEFont object when finished with it. **Note:** If you want to use `WinAnsiEncoding` on UNIX, use this method or PDEFontCreateFromSysFontWithParams().

**Parameters**

- `sysFont` (`IN PDSysFont`): A PDSysFont object referencing a system font.
- `sysEnc` (`IN PDSysEncoding`): A PDSysEncoding object.
- `useThisBaseFont` (`IN ASAtom`): The base font. An exception will be raised if the base font name passed is a subset name `(XXXXXX+FontName)` or an empty string.
- `createFlags` (`IN ASUns32`): One of the PDEFontCreateFlags. These are combined with the requirements reported by PDSysFontGetCreateFlags(), so the font may end up embedded or subset even when `createFlags` did not ask for it.

**Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)

The newly created PDEFont object.

**Exceptions**

- `peErrCantEmbedFont`: The sysFont's `PDEFontAttrs` report `cantEmbed` and the resolved create flags require embedding.

**See also:** [`PDSysFontGetCreateFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetCreateFlags), [`PDSysFontGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetAttrs)

#### PDEFontCreateFromSysFontAndEncodingInCosDoc

```cpp
PDEFont PDEFontCreateFromSysFontAndEncodingInCosDoc(IN PDSysFont sysFont, IN PDSysEncoding sysEnc, IN ASAtom useThisBaseFont, IN ASUns32 createFlags, IN CosDoc cosDoc)
```

Header: `PEWProcs.h:3068`

Creates a font object like PDEFontCreateFromSysFontAndEncoding(), except that the client can specify the CosDoc in which the font is created. Create a PDEFont from `sysFont` and `sysEnc`. If it fails, it raises an exception. User can call PDSysFontGetCreateFlags() to see if the combination of sysFont and sysEnc makes sense. Call PDERelease() to dispose of the returned PDEFont object when finished with it. **Note:** If you want to use `WinAnsiEncoding` on UNIX, use this method or PDEFontCreateFromSysFontWithParams().

**Parameters**

- `sysFont` (`IN PDSysFont`): A PDSysFont object referencing a system font.
- `sysEnc` (`IN PDSysEncoding`): A PDSysEncoding object.
- `useThisBaseFont` (`IN ASAtom`): The base font. An exception will be raised if the base font name passed is a subset name `(XXXXXX+FontName)` or an empty string.
- `createFlags` (`IN ASUns32`): One of the PDEFontCreateFlags. These are combined with the requirements reported by PDSysFontGetCreateFlags(), so the font may end up embedded or subset even when `createFlags` did not ask for it.
- `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of resource. It may be `NULL`.

**Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)

The newly created PDEFont object.

**Exceptions**

- `peErrBadFont`
- `peErrCantEmbedFont`: The sysFont's `PDEFontAttrs` report `cantEmbed` and the resolved create flags require embedding.

**See also:** [`PDSysFontGetCreateFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetCreateFlags), [`PDSysFontGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetAttrs)

#### PDEFontCreateFromSysFontEx

```cpp
PDEFont PDEFontCreateFromSysFontEx(IN PDSysFont sysFont, IN ASUns32 flags, IN ASAtom snapshotName, IN ASFixed *mmDesignVec)
```

Header: `PEWProcs.h:1541`

Creates a PDEFont corresponding to a font in the system. If the font is a Multiple Master font, `mmDesignVector` points to the design vector, whose length must equal the number of design axes of the font. Call PDERelease() to dispose of the returned font object when finished with it. The PDEFontCreateFlags flags kPDEFontCreateEmbedded and kPDEFontWillSubset must both be set in order to subset a font. If you create a PDEFont that is subsetted, call PDEFontSubsetNow() on this font afterwards.

**Parameters**

- `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font.
- `flags` (`IN ASUns32`): IN/OUT Indicates whether to embed the font and whether to subset the font. It must be one of PDEFontCreateFlags. If you want to subset a font, set both the kPDEFontCreateEmbedded and kPDEFontWillSubset flags.
- `snapshotName` (`IN ASAtom`): IN/OUT The name to be associated with this particular instantiation of the PDEFont.
- `mmDesignVec` (`IN ASFixed *`): IN/OUT A pointer to the Multiple Master font design vector.

**Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)

The PDEFont corresponding to `sysFont`.

**Exceptions**

- `peErrCantCreateFontSubset`
- `peErrCantGetAttrs`
- `peErrCantGetWidths`
- `peErrCantEmbedFont`
- `genErrBadParm`
- `genErrResourceLoadFailed`

**See also:** [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), [`PDEFontCreateWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateWithParams), [`PDEnumSysFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEnumSysFonts)

#### PDEFontCreateFromSysFontExInCosDoc

```cpp
PDEFont PDEFontCreateFromSysFontExInCosDoc(IN PDSysFont sysFont, IN ASUns32 flags, IN ASAtom snapshotName, IN ASFixed *mmDesignVec, IN CosDoc cosDoc)
```

Header: `PEWProcs.h:2997`

Creates a font object like PDEFontCreateFromSysFontEx(), except that the client can specify the CosDoc in which the font is created. If the font is a Multiple Master font, `mmDesignVector` points to the design vector, whose length must equal the number of design axes of the font. Call PDERelease() to dispose of the returned font object when finished with it. The PDEFontCreateFlags flags kPDEFontCreateEmbedded and kPDEFontWillSubset must both be set in order to subset a font. If you create a PDEFont that is subsetted, call PDEFontSubsetNow() on this font afterwards.

**Parameters**

- `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font.
- `flags` (`IN ASUns32`): IN/OUT Indicates whether to embed the font and whether to subset the font. It must be one of PDEFontCreateFlags. If you want to subset a font, set both the kPDEFontCreateEmbedded and kPDEFontWillSubset flags.
- `snapshotName` (`IN ASAtom`): IN/OUT The name to be associated with this particular instantiation of the PDEFont.
- `mmDesignVec` (`IN ASFixed *`): IN/OUT A pointer to the Multiple Master font design vector.
- `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of resource. It may be `NULL`.

**Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)

The PDEFont corresponding to `sysFont`.

**Exceptions**

- `peErrCantCreateFontSubset`
- `peErrCantGetAttrs`
- `peErrCantGetWidths`
- `peErrCantEmbedFont`
- `genErrBadParm`
- `genErrResourceLoadFailed`

**See also:** [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), [`PDEFontCreateWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateWithParams), [`PDEnumSysFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEnumSysFonts)

#### PDEFontCreateFromSysFontInCosDoc

```cpp
PDEFont PDEFontCreateFromSysFontInCosDoc(IN PDSysFont sysFont, IN ASUns32 flags, IN CosDoc cosDoc)
```

Header: `PEWProcs.h:2950`

Creates a font object like PDEFontCreateFromSysFont(), except that the client can specify the CosDoc in which the font is created. Call PDERelease() to dispose of the returned font object when finished with it. The PDEFontCreateFlags flags kPDEFontCreateEmbedded and kPDEFontWillSubset must both be set in order to subset a font. If you create a PDEFont that is a subset, call PDEFontSubsetNow() on this font afterwards. **Note:** If you want to use `WinAnsiEncoding` on UNIX, do not use this method. Use PDEFontCreateFromSysFontWithParams() or PDEFontCreateFromSysFontAndEncoding() instead.

**Parameters**

- `sysFont` (`IN PDSysFont`): A PDSysFont object referencing a system font.
- `flags` (`IN ASUns32`): Indicates whether to embed the font and whether to subset the font. It must be one of PDEFontCreateFlags. If you want to subset a font, set both the kPDEFontCreateEmbedded and kPDEFontWillSubset flags.
- `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of resource. It may be `NULL`.

**Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)

The PDEFont corresponding to `sysFont`.

**Exceptions**

- `peErrCantCreateFontSubset`
- `peErrCantGetAttrs`
- `peErrCantGetWidths`
- `peErrCantEmbedFont`
- `genErrBadParm`
- `genErrResourceLoadFailed`

**See also:** [`PDEFontCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreate), [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFontAndEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontAndEncoding), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), [`PDEnumSysFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEnumSysFonts)

#### PDEFontCreateFromSysFontWithParams

```cpp
PDEFont PDEFontCreateFromSysFontWithParams(IN PDSysFont sysFont, IN PDEFontCreateFromSysFontParams params)
```

Header: `PEWProcs.h:2022`

Used to obtain a PDEFont corresponding to a font in the system. Call PDERelease() to dispose of the returned PDEFont object when finished with it. **Note:** If you want to use `WinAnsiEncoding` on UNIX, use this method or PDEFontCreateFromSysFontAndEncoding() instead.

**Parameters**

- `sysFont` (`IN PDSysFont`): The system font.
- `params` (`IN PDEFontCreateFromSysFontParams`): The parameters structure.

**Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)

The newly created PDEFont object.

**Exceptions**

- `peErrCantCreateFontSubset`
- `genErrBadParm`

#### PDEFontCreateInCosDoc

```cpp
PDEFont PDEFontCreateInCosDoc(IN PDEFontAttrsP attrsP, IN ASUns32 attrsSize, IN ASInt32 firstChar, IN ASInt32 lastChar, IN ASInt16 *widthsP, IN char **encoding, IN ASAtom encodingBaseName, IN ASStm fontStm, IN ASInt32 len1, IN ASInt32 len2, IN ASInt32 len3, IN CosDoc cosDoc)
```

Header: `PEWProcs.h:2908`

Creates a font object like PDEFontCreate(), except that the client can specify the CosDoc in which the font is created. The PDEFont may be represented as an embedded font (a FontFile entry in the font descriptor of the PDF file). To create a PDEFont that is stored as an embedded font, the FontFile stream may be passed in `fontStm`, and the `len1`, `len2`, and `len3` parameters contain the `Length1`, `Length2`, and `Length3` values of the FontFile stream attributes dictionary. See the description of Embedded Font Programs in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.9, page 288. You can find this document on the web store of the International Standards Organization (ISO). The caller must close `fontStm` with ASStmClose() after invoking PDEFontCreate(). Call PDERelease() to dispose of the returned font object when finished with it.

**Parameters**

- `attrsP` (`IN PDEFontAttrsP`): A pointer to a `PDEFontAttrs` structure for the font attributes.
- `attrsSize` (`IN ASUns32`): The size of the `attrsP` buffer in bytes.
- `firstChar` (`IN ASInt32`): The first character index for the widths array, `widthsP`.
- `lastChar` (`IN ASInt32`): The last character index for the widths array, `widthsP`.
- `widthsP` (`IN ASInt16 *`): A pointer to the widths array.
- `encoding` (`IN char **`): An array of 256 pointers to glyph names specifying the custom encoding. If any pointer is `NULL`, no encoding information is written for that entry.
- `encodingBaseName` (`IN ASAtom`): The encoding base name if the encoding is a custom encoding. If the encoding is `NULL`, `encodingBaseName` is used as the value of the encoding, and must be one of `WinAnsiEncoding`, `MacRomanEncoding`, or `MacExpertEncoding`. If no encoding value is desired, use ASAtomNull.
- `fontStm` (`IN ASStm`): The stream with font information.
- `len1` (`IN ASInt32`): The length in bytes of the ASCII portion of the Type 1 font file after it has been decoded. For other font formats, such as TrueType or CFF, only `len1` is used, and it is the size of the font.
- `len2` (`IN ASInt32`): The length in bytes of the encrypted portion of the Type 1 font file after it has been decoded.
- `len3` (`IN ASInt32`): The length in bytes of the portion of the Type 1 font file that contains the 512 zeros, plus the `cleartomark` operator, plus any following data.
- `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of resource. It may be `NULL`.

**Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)

The specified PDEFont.

**Exceptions**

- `peErrCantCreateFontSubset`
- `peErrCantGetAttrs`
- `peErrCantGetWidths`
- `peErrCantEmbedFont`
- `genErrResourceLoadFailed`

**See also:** [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontEx), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), [`PDEFontCreateWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateWithParams)

#### PDEFontCreateToUnicodeNow

```cpp
void PDEFontCreateToUnicodeNow(IN PDEFont font, IN CosDoc cosDoc)
```

Header: `PEWProcs.h:2215`

This function creates the / ToUnicode table. The user can check the return value of PDEFontGetCreateNeedFlags() to see if calling PDEFontCreateToUnicodeNow() is needed.

**Parameters**

- `font` (`IN PDEFont`): IN/OUT An object of type PDEFont.
- `cosDoc` (`IN CosDoc`): IN/OUT The container document.

**Returns:** `void`

**Exceptions**

- `genErrBadParm`
- `peErrWrongPDEObjectType`

#### PDEFontCreateWidthsNow

```cpp
void PDEFontCreateWidthsNow(IN PDEFont font, IN CosDoc cosDoc)
```

Header: `PEWProcs.h:2202`

This function creates width entries for `font`. User can check the return value of PDEFontGetCreateNeedFlags() to see if calling PDEFontCreateWidthsNow() is needed.

**Parameters**

- `font` (`IN PDEFont`): IN/OUT The font for which to create width entries.
- `cosDoc` (`IN CosDoc`): IN/OUT The container document.

**Returns:** `void`

**Exceptions**

- `genErrBadParm`
- `peErrWrongPDEObjectType`

#### PDEFontCreateWithParams

```cpp
PDEFont PDEFontCreateWithParams(IN PDEFontCreateParams params)
```

Header: `PEWProcs.h:1407`

Creates a new PDEFont from `params`. The PDEFont may be represented as an embedded font (a FontFile value in PDF). To create a PDEFont that will be stored as an embedded font, the FontFile stream may be passed as `fontStm`, and the `len1`, `len2`, and `len3` parameters contain the Length1, Length2, and Length3 values of the FontFile. The caller must close the `fontStm` after calling this method. This method supports multi-byte fonts. This method extends PDEFontCreate() to support multi-byte fonts. Call PDERelease() to dispose of the returned font object when finished with it. @since

**Parameters**

- `params` (`IN PDEFontCreateParams`): IN/OUT A pointer to a structure containing all font
  parameters necessary to fully define a font.

**Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)

**Exceptions**

- `peErrCantCreateFontSubset`
- `peErrCantGetAttrs`
- `peErrCantGetWidths`
- `peErrCantEmbedFont`
- `genErrBadParm`
- `genErrResourceLoadFailed`

**See also:** [`PDEFontCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreate), [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontEx)

#### PDEFontCreateWithParamsInCosDoc

```cpp
PDEFont PDEFontCreateWithParamsInCosDoc(IN PDEFontCreateParams params, IN CosDoc cosDoc)
```

Header: `PEWProcs.h:3036`

Creates a font object like PDEFontCreateWithParams(), except that the client can specify the CosDoc in which the font is created. Creates a new PDEFont from `params`. The PDEFont may be represented as an embedded font (a FontFile value in PDF). To create a PDEFont that will be stored as an embedded font, the FontFile stream may be passed as `fontStm`, and the `len1`, `len2`, and `len3` parameters contain the `Length1`, `Length2`, and `Length3` values of the FontFile. The caller must close the `fontStm` after calling this method. This method supports multi-byte fonts. This method extends PDEFontCreate() to support multi-byte fonts. Call PDERelease() to dispose of the returned font object when finished with it.

**Parameters**

- `params` (`IN PDEFontCreateParams`): IN/OUT A pointer to a structure containing all font parameters necessary to fully define a font.
- `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of resource. It may be `NULL`.

**Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)

A PDEFont object of the font described by the parameters.

**Exceptions**

- `peErrCantCreateFontSubset`
- `peErrCantGetAttrs`
- `peErrCantGetWidths`
- `peErrCantEmbedFont`
- `genErrBadParm`
- `genErrResourceLoadFailed`

**See also:** [`PDEFontCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreate), [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontEx)

#### PDEFontEmbedNow

```cpp
void PDEFontEmbedNow(IN PDEFont font, IN CosDoc cosDoc)
```

Header: `PEWProcs.h:2189`

This function embeds a font stream. User can check the return value of PDEFontGetCreateNeedFlags() to see if calling PDEFontEmbedNow() is needed.

**Parameters**

- `font` (`IN PDEFont`): The font to embed.
- `cosDoc` (`IN CosDoc`): The container document.

**Returns:** `void`

**Exceptions**

- `peErrCantEmbedFont`
- `peErrToUnicodeUsesPUA`
- `peErrBadFont`
- `genErrBadParm`
- `peErrWrongPDEObjectType`

**See also:** [`PDEFontEmbedNowDontSubset`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontEmbedNowDontSubset), [`PDEFontIsEmbedded`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontIsEmbedded)

#### PDEFontEmbedNowDontSubset

```cpp
void PDEFontEmbedNowDontSubset(IN PDEFont font, IN CosDoc cosDoc)
```

Header: `PEWProcs.h:1619`

Embeds the given PDEFont inside doc without creating a subset. Use this method instead of PDEFontSubsetNow() if you created the font with the `willSubset` flag but changed your mind.

**Parameters**

- `font` (`IN PDEFont`): The font to embed.
- `cosDoc` (`IN CosDoc`): The container document.

**Returns:** `void`

**See also:** [`PDEFontEmbedNow`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontEmbedNow), [`PDEFontIsEmbedded`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontIsEmbedded)

#### PDEFontGetAttrs

```cpp
void PDEFontGetAttrs(IN PDEFont font, OUT PDEFontAttrsP attrsP, IN ASUns32 attrsSize)
```

Header: `PERProcs.h:1039`

Gets the attributes for a font object. **Note:** PDEFontGetAttrs() cannot fill in the `cantEmbed` and `protection` fields. PDSysFontAttrs() can return this information to you for system fonts. **Note:** PDEFontGetAttrs() fills in the `fontBBox` portion of the `PDEFontAttrs` as ASInt16 objects, even though the member says it is an `ASFixedRect`. Make sure to properly convert those values using ASInt16ToFixed() so that you get the proper `ASFixedRect` associated with that font.

**Parameters**

- `font` (`IN PDEFont`): IN/OUT A PDEFont whose attributes are found.
- `attrsP` (`OUT PDEFontAttrsP`): IN/OUT (Filled by the method) A pointer to a `PDEFontAttrs` structure for the font attributes.
- `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrCantGetAttrs`
- `genErrBadParm`
- `genErrResourceLoadFailed`

**See also:** [`PDEFontGetNumCodeBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetNumCodeBytes)

#### PDEFontGetCosObj

```cpp
void PDEFontGetCosObj(IN PDEFont font, OUT CosObj *cosObjP)
```

Header: `PERProcs.h:1071`

Gets a Cos object for a PDEFont.

**Parameters**

- `font` (`IN PDEFont`): IN/OUT A PDEFont whose Cos object is obtained.
- `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object corresponding to `font`.

**Returns:** `void`

**Exceptions**

- `genErrResourceLoadFailed`
- `peErrWrongPDEObjectType`

**See also:** [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj)

#### PDEFontGetCreateNeedFlags

```cpp
ASUns32 PDEFontGetCreateNeedFlags(IN PDEFont font)
```

Header: `PEWProcs.h:2172`

This function returns flags indicating what needs to be done to make PDEFont complete. kPDEFontCreateNeedWidths can be cleared by PDEFontCreateWidthsNow(). kPDEFontCreateNeedToUnicode can be cleared by PDEFontCreateToUnicodeNow(). kPDEFontCreateNeedEmbed can be cleared by PDEFontEmbedNow().

**Parameters**

- `font` (`IN PDEFont`): The font object.

**Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)

A value corresponding to PDEFontCreateNeedFlags().

#### PDEFontGetNumCodeBytes

```cpp
ASInt16 PDEFontGetNumCodeBytes(IN PDEFont font, IN ASUns8 *text, IN ASInt32 len)
```

Header: `PERProcs.h:1563`

Gets the number of bytes comprising the next code in a string of single or multi-byte character codes.

**Parameters**

- `font` (`IN PDEFont`): IN/OUT A PDEFont object returned from one of the `PDEFontCreate` methods.
- `text` (`IN ASUns8 *`): IN/OUT A pointer to a string of characters.
- `len` (`IN ASInt32`): IN/OUT The length, in bytes, of the string of characters, starting with the character pointed to by text.

**Returns:** [`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)

The number of bytes in the next character code pointed to by text.

**Exceptions**

- `genErrNoMemory`

**See also:** [`PDEFontIsMultiByte`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontIsMultiByte), [`PDEFontSumWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontSumWidths), [`PDEFontGetOneByteEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetOneByteEncoding)

#### PDEFontGetOneByteEncoding

```cpp
ASBool PDEFontGetOneByteEncoding(IN PDEFont font, OUT ASAtom *encodingDelta)
```

Header: `PERProcs.h:1788`

Gets an array of delta encodings for the given one byte PDEFont. For encodingDelta, see the description of encoding in the ISO 32000 document, 1.7 or 2.0. You can find this document on the web store of the International Standards Organization. The array must be allocated to hold 256 entries.

**Parameters**

- `font` (`IN PDEFont`): IN/OUT A PDEFont object returned from one of the `PDEFontCreate` methods.
- `encodingDelta` (`OUT ASAtom *`): IN/OUT (Filled by the method) A pointer to an ASAtom array that is filled with the delta encodings for font. Each entry is the ASAtom for a glyph name that differs from the base encoding. For more information about font encodings see the description of Base Encoding in the Character Encoding section of the ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 9.6.6, page 262.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if `encodingDelta` is filled, `false` otherwise.

**Exceptions**

- `genErrNoMemory`

**See also:** [`PDEFontIsMultiByte`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontIsMultiByte), [`PDEFontSumWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontSumWidths), [`PDEFontGetNumCodeBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetNumCodeBytes)

#### PDEFontGetSysEncoding

```cpp
PDSysEncoding PDEFontGetSysEncoding(IN PDEFont pdeFont)
```

Header: `PERProcs.h:2482`

Gets the system encoding object associated with a font object.

**Parameters**

- `pdeFont` (`IN PDEFont`): A PDEFont whose system encoding is found.

**Returns:** [`PDSysEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncoding)

The system encoding object.

**Exceptions**

- `genErrBadParm`
- `genErrResourceLoadFailed`

**See also:** [`PDEFontSetSysEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontSetSysEncoding)

#### PDEFontGetSysFont

```cpp
PDSysFont PDEFontGetSysFont(IN PDEFont pdeFont)
```

Header: `PERProcs.h:2470`

Gets the system font object associated with a font object.

**Parameters**

- `pdeFont` (`IN PDEFont`): A PDEFont whose system font is found.

**Returns:** `PDSysFont`

The system font object.

**Exceptions**

- `genErrBadParm`
- `genErrResourceLoadFailed`

**See also:** [`PDFindSysFontForPDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFontForPDEFont), [`PDEFontSetSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontSetSysFont)

#### PDEFontGetWidths

```cpp
void PDEFontGetWidths(IN PDEFont font, OUT ASInt16 *widthsP)
```

Header: `PERProcs.h:1058`

Gets the widths for a font object.

**Parameters**

- `font` (`IN PDEFont`): IN/OUT A PDEFont whose widths are found.
- `widthsP` (`OUT ASInt16 *`): IN/OUT (Filled by the method) A pointer to the widths array. `widthsP` must have room for 256 values. The widths are returned in character space (1000 EM units). An EM is a typographic unit of measurement equal to the size of a font. To convert to text space, divide the value returned by `1000`. To convert to user space, multiply the text space value by the font size.

**Returns:** `void`

**Exceptions**

- `peErrCantGetWidths`
- `genErrBadParm`
- `genErrResourceLoadFailed`

**See also:** [`PDEFontCreateWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateWithParams)

#### PDEFontGetWidthsNow

```cpp
void PDEFontGetWidthsNow(IN PDEFont font, IN CosDoc cosDoc)
```

Header: `PEWProcs.h:1631`

Gets a Type0 font's width information for only those characters used in the file. Call this routine when the font was created with the kPDEFontDeferWidths flag but without the kPDEFontCreateEmbedded flag (if the font is to be embedded, call PDEFontSubsetNow(), which also gets the width info).

**Parameters**

- `font` (`IN PDEFont`): The font whose widths are found.
- `cosDoc` (`IN CosDoc`): The container document.

**Returns:** `void`

#### PDEFontIsEmbedded

```cpp
ASBool PDEFontIsEmbedded(IN PDEFont pdeFont)
```

Header: `PERProcs.h:2457`

Tests whether a font is an embedded font in the document in which it was created.

**Parameters**

- `pdeFont` (`IN PDEFont`): A PDEFont object to test.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if the font is embedded, `false` if it is not, or if it was created in one document and embedded in a different document.

**See also:** [`PDEFontEmbedNow`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontEmbedNow), [`PDEFontEmbedNowDontSubset`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontEmbedNowDontSubset)

#### PDEFontIsMultiByte

```cpp
ASBool PDEFontIsMultiByte(IN PDEFont font)
```

Header: `PERProcs.h:1592`

Tests whether a font contains any multi-byte characters.

**Parameters**

- `font` (`IN PDEFont`): IN/OUT A PDEFont object returned from one of the `PDEFontCreate` methods to test.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if the font contains any multi-byte characters, `false` otherwise.

**See also:** [`PDEFontGetNumCodeBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetNumCodeBytes), [`PDEFontSumWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontSumWidths), [`PDEFontGetOneByteEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetOneByteEncoding)

#### PDEFontSetSysEncoding

```cpp
void PDEFontSetSysEncoding(IN PDEFont pdeFont, IN PDSysEncoding sysEnc)
```

Header: `PEWProcs.h:2378`

Sets the system encoding object associated with a font object. **Note:** Changing the system encoding may produce unexpected results.

**Parameters**

- `pdeFont` (`IN PDEFont`): A PDEFont whose system encoding is set.
- `sysEnc` (`IN PDSysEncoding`): The new system encoding object.

**Returns:** `void`

**Exceptions**

- `genErrBadParm`
- `genErrResourceLoadFailed`

**See also:** [`PDEFontGetSysEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetSysEncoding)

#### PDEFontSetSysFont

```cpp
void PDEFontSetSysFont(IN PDEFont pdeFont, IN PDSysFont sysFont)
```

Header: `PEWProcs.h:2363`

Sets the system font object to be used with a font object that does not currently have a system font associated with it.

**Parameters**

- `pdeFont` (`IN PDEFont`): A PDEFont whose system font is set.
- `sysFont` (`IN PDSysFont`): The new system font object.

**Returns:** `void`

**Exceptions**

- `genErrBadParm`
- `genErrResourceLoadFailed`

**See also:** [`PDEFontGetSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetSysFont)

#### PDEFontSubsetNow

```cpp
void PDEFontSubsetNow(IN PDEFont font, IN CosDoc cosDoc)
```

Header: `PEWProcs.h:1336`

Subsets a given PDEFont in a CosDoc. If you created font with PDEFontCreateFromSysFont(), you must have set both the kPDEFontCreateEmbedded and kPDEFontWillSubset set in the `flags` parameter, to be able to subset the font. **Note:** This method does not change the reference count.

**Parameters**

- `font` (`IN PDEFont`): IN/OUT The PDEFont to subset.
- `cosDoc` (`IN CosDoc`): IN/OUT The CosDoc whose font is subsetted.

**Returns:** `void`

**Exceptions**

- `peErrCantCreateFontSubset`
- `peErrCantGetAttrs`
- `peErrCantGetWidths`
- `peErrCantEmbedFont`
- `peErrToUnicodeUsesPUA`
- `peErrBadFont`
- `genErrBadParm`
- `genErrResourceLoadFailed`

**See also:** [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont)

#### PDEFontSumWidths

```cpp
ASInt32 PDEFontSumWidths(IN PDEFont font, IN ASUns8 *text, IN ASInt32 len)
```

Header: `PERProcs.h:1544`

Gets the sum of the widths of `len` characters from a string of single or multi-byte characters.

**Parameters**

- `font` (`IN PDEFont`): A PDEFont object returned from one of the PDEFontCreate methods.
- `text` (`IN ASUns8 *`): A pointer to a string of characters.
- `len` (`IN ASInt32`): The length of string in bytes.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The width of the text string in EM space. (In EM space, the width of 'M' is about 1000 EM units).

**Exceptions**

- `genErrNoMemory`
- `pdErrBadResMetrics`
- `genErrResourceLoadFailed`
- `peErrWrongPDEObjectType`

**See also:** [`PDEFontGetNumCodeBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetNumCodeBytes), [`PDEFontIsMultiByte`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontIsMultiByte), [`PDEFontGetOneByteEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetOneByteEncoding)

#### PDEFontTranslateGlyphIdsToUnicode

```cpp
ASUns32 PDEFontTranslateGlyphIdsToUnicode(IN PDEFont font, IN ASUns8 *text, IN ASUns32 textLen, OUT ASUns8 *unicodeStr, IN ASUns32 size)
```

Header: `PEWProcs.h:2040`

Translates a string to Unicode values. The PDEFont must have a / ToUnicode table.

**Parameters**

- `font` (`IN PDEFont`): IN/OUT The font.
- `text` (`IN ASUns8 *`): IN/OUT The string to convert.
- `textLen` (`IN ASUns32`): IN/OUT The length of `text` in bytes.
- `unicodeStr` (`OUT ASUns8 *`): IN/OUT (Filled by the method) A buffer to hold the translated string.
- `size` (`IN ASUns32`): IN/OUT The size of the `unicodeStr` buffer.

**Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)

`0` if the string was successfully translated. If `unicodeStr` is too small for the translated string, it returns the number of bytes required.

**Exceptions**

- `genErrBadParm`

#### PDEReleaseSpan

```cpp
void PDEReleaseSpan(IN PDESpanSetP pdeSpan)
```

Header: `PEWProcs.h:2693`

Releases a PDESpan object that is returned by PDEFontAddGlyphs().

**Parameters**

- `pdeSpan` (`IN PDESpanSetP`)

**Returns:** `void`

**Exceptions**

- `genErrBadParm`

**See also:** [`PDEFontAddGlyphs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontAddGlyphs)

### Structures (1)

#### PDEFont

```cpp
typedef struct _t_PDEFont* PDEFont
```

Header: `PEExpT.h:312`

A reference to a font used on a page in a PDF file. It may be equated with a font in the system. A PDEFont is not the same as a PDFont; a PDFont is associated with a particular document.

**See also:** [`PDEFontCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreate), [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontEx), [`PDEFontCreateWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateWithParams), [`PDETextGetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetFont), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

### Enums (2)

#### PDEFontCreateFlags

Header: `PEExpT.h:1954`

Flags for `PDEFontCreateFromSysFont()`. If you want to subset a font, set both the `kPDEFontCreateEmbedded` and `kPDEFontWillSubset` flags.

**Values**

- `kPDEFontCreateEmbedded = 0x0001`: Embed the font. Create an embedded font. By itself, this will not subset the font.
- `kPDEFontWillSubset = 0x0002`: Subset the font. If you want to subset a font, set both the `kPDEFontCreateEmbedded` and kPDEFontWillSubset flags. You must call `PDEFontSubsetNow()` to actually subset the font. Both embedding and subsetting a font creates a CFF font.
- `kPDEFontDoNotEmbed = 0x0004`: Do not embed the font. You cannot set both this and the `kPDEFontWillSubset` flags. Nor can you set `kPDEFontCreateEmbedded`.

  This flag is a preference: if PDSysFontGetCreateFlags() reports `kPDEFontCreateEmbedded` for the PDSysFont/PDSysEncoding combination, embedding is required and this flag has no effect.
- `kPDEFontEncodeByGID = 0x0008`: Create a CIDFont with identity (GID) encoding.
- `kPDEFontDeferWidths = 0x0010`: Wait to get the widths until later (this affects Type0 fonts only).
- `kPDEFontCreateSubset = kPDEFontWillSubset`
- `kPDEFontCreateGIDOverride = 0x0020`: PDFLib will convert `cp` to `gid` with identity embedded.
- `kPDEFontCreateToUnicode = 0x0040`: Create a ToUnicode CMap.
- `kPDEFontCreateAllWidths = 0x0080`: Supply the entire widths table (this affects Type0 fonts only).
- `kPDEFontCreateEmbedOpenType = 0x0100`: Embed an OpenType style font subset, if appropriate.
- `kPDEFontCreateReserved1 = 0x0200`: Reserved for internal usage
- `kPDEFontCreateFullCIDSet = 0x0400`: Create CIDSet entry from all CIDs present in subsetted Type0 CID Fonts containing glyph descriptions based on identity encoded TrueType fonts (subtype CIDFontType2). Subsetted identity encoded Type0 fonts can have more glyphs than asked for to avoid glyph renumbering. Default behavior is to only include CIDs used in PDF page content stream in CIDset
- `kPDEFontThrowIfToUnicodeUsesPUA = 0x0800`: If kPDEFontThrowIfToUnicodeUsesPUA flag is passed along with kPDEFontCreateToUnicode and kPDEFontCreateSubset, throw error in PDEFont embedding APIs if the created ToUnicode table contains Private Use Area (Range: E000-F8FF in plane 0 and Supplemental Private Use Area A & B) Unicode values
- `kPDEFontInvisibleRenderingMode = 0x1000`: Reserved for internal usage - This flag is passed if PDEFont is used with Text rendering mode 3(Invisible)

  • While converting to PDFXxx and PDFAxx if fetched fontfile stream data from Cooltype is empty (NULL) , then with this flag enabled entire fontfile stream data from input file is copied to embedded font in output file

**See also:** [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontAndEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontAndEncoding), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), `kPDEFontWillSubset`

#### PDEFontCreateNeedFlags

Header: `PEExpT.h:2020`

Flags for PDEFontGetCreateNeedFlags().

**Values**

- `kPDEFontCreateNeedWidths = 0x00010000`: It is necessary to to create the width.
- `kPDEFontCreateNeedToUnicode = 0x00020000`: It is necessary to to create the ToUnicode stream.
- `kPDEFontCreateNeedEmbed = 0x00040000`: It is necessary to to embed it.

### Definitions (2)

#### kPDEFontNoEditableEmbedding

Header: `PEExpT.h:2045`

Value: `0x00000002`

Flags for protection of `PDEFontAttrs`: editable embedding is not allowed. The font may be embedded for viewing and printing, but the embedded copy is not licensed for editing the document. PDEFontEmbedNow() does not test this bit; an application that must honor it should check `protection` itself.

**See also:** `PDEFontAttrs`

#### kPDEFontNoEmbedding

Header: `PEExpT.h:2036`

Value: `0x00000001`

Flags for protection of `PDEFontAttrs`: embedding is not allowed. `cantEmbed` is set whenever this bit is set.

**See also:** `PDEFontAttrs`

## PDEForm

### Functions (17)

#### PDEFormAcquireXGroup

```cpp
PDEXGroup PDEFormAcquireXGroup(IN PDEForm pdeForm)
```

Header: `PERProcs.h:1999`

Acquires the transparency group dictionary of the XObject form. Call PDERelease() to dispose of the PDEXGroup when finished with it.

**Parameters**

- `pdeForm` (`IN PDEForm`): IN/OUT The from.

**Returns:** [`PDEXGroup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXGroup)

The transparency group object.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEFormCreateClone

```cpp
PDEForm PDEFormCreateClone(IN PDEForm form)
```

Header: `PEWProcs.h:2586`

Creates a new form from an existing form object. Creates a copy of the PDEForm, including the underlying CosStream. Call PDERelease() to dispose of the returned PDEForm object when finished with it.

**Parameters**

- `form` (`IN PDEForm`): The form object from which a new PDEForm is created.

**Returns:** [`PDEForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEForm)

The newly created form object.

**See also:** [`PDEFormCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormCreateFromCosObj)

#### PDEFormCreateFromCosObj

```cpp
PDEForm PDEFormCreateFromCosObj(IN const CosObj *xObjectP, IN const CosObj *resourcesP, IN ASFixedMatrixP matrixP)
```

Header: `PEWProcs.h:735`

Superseded by PDEFormCreateFromCosObjEx() in Acrobat 10.0. Creates a new form from an existing Cos object. Call PDERelease() to dispose of the returned form object when finished with it.

**Parameters**

- `xObjectP` (`IN const CosObj *`): The Cos object from which a PDEForm is created.
- `resourcesP` (`IN const CosObj *`): The `xObjectP` parameter's Resources dictionary. If you do not pass in a Resource object, subsequent calls to PDPageAcquirePDEContent() will fail (after the file is saved).
- `matrixP` (`IN ASFixedMatrixP`): A pointer to an `ASFixedMatrix` that holds the transformation matrix to use for the form.

**Returns:** [`PDEForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEForm)

The newly created form object.

**See also:** [`PDEFormCreateClone`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormCreateClone), [`PDEFormGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetCosObj), [`PDEFormCreateFromCosObjEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormCreateFromCosObjEx)

#### PDEFormCreateFromCosObjEx

```cpp
PDEForm PDEFormCreateFromCosObjEx(IN const CosObj *xObjectP, IN const CosObj *resourcesP, IN ASDoubleMatrixP matrixP)
```

Header: `PEWProcs.h:3681`

Creates a new form from an existing Cos object. Supersedes PDEFormCreateFromCosObj() in Acrobat 10.0. Call PDERelease() to dispose of the returned form object when finished with it.

**Parameters**

- `xObjectP` (`IN const CosObj *`): The Cos object from which a PDEForm is created.
- `resourcesP` (`IN const CosObj *`): The `xObjectP` parameter's Resources dictionary. If you do not pass in a Resource object, subsequent calls to PDPageAcquirePDEContent() will fail (after the file is saved).
- `matrixP` (`IN ASDoubleMatrixP`): A pointer to an `ASDoubleMatrix` that holds the transformation matrix to use for the form.

**Returns:** [`PDEForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEForm)

The newly created form object.

**See also:** [`PDEFormCreateClone`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormCreateClone), [`PDEFormGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetCosObj), [`PDEFormCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormCreateFromCosObj)

#### PDEFormGetBBox

```cpp
void PDEFormGetBBox(IN PDEForm form, OUT ASFixedRectP bboxP)
```

Header: `PEWProcs.h:2784`

Gets the bounding box for a PDEform. The result is the concatenation of the CTM and the Cos level form matrix applied on cos level bounding box. The returned bounding box is guaranteed to encompass the PDEForm, but is not guaranteed to be the smallest box that could contain the form object. Note: For other elements, PDEElementGetBBox() would return the correct bounding box values.

**Parameters**

- `form` (`IN PDEForm`): The PDEForm for which the bounding box is required.
- `bboxP` (`OUT ASFixedRectP`): The resulting bounding box.

**Returns:** `void`

**See also:** [`PDEElementGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetBBox), [`PDEFormGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetMatrix)

#### PDEFormGetContent

```cpp
PDEContent PDEFormGetContent(IN PDEForm form)
```

Header: `PEWProcs.h:749`

Gets a PDEContent object for a form. **Note:** Unlike other `GetContent` methods, this method does increment the reference count of the returned PDEContent. Call PDERelease() to dispose of the returned PDEContent object when finished with it.

**Parameters**

- `form` (`IN PDEForm`): The form whose content is obtained.

**Returns:** [`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent)

The content for `form`.

**Exceptions**

- `peErrWrongPDEObjectType`
- `peErrPStackUnderflow`

#### PDEFormGetContentToCosObjFlags

```cpp
ASUns32 PDEFormGetContentToCosObjFlags(IN PDEForm form)
```

Header: `PERProcs.h:2998`

Retrieves the `PDEContentToCosObjFlags` for this form. The flags were previously set by `PDEFormSetContentToCosObjFlags()`.

**Parameters**

- `form` (`IN PDEForm`)

**Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)

#### PDEFormGetCosObj

```cpp
void PDEFormGetCosObj(IN PDEForm form, OUT CosObj *cosObjP)
```

Header: `PERProcs.h:999`

Gets a Cos object for a form.

**Parameters**

- `form` (`IN PDEForm`): IN/OUT The form whose Cos object is obtained.
- `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the form.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEFormCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormCreateFromCosObj)

#### PDEFormGetLeading

```cpp
ASDouble PDEFormGetLeading(IN PDEForm form)
```

Header: `PERProcs.h:3437`

Gets the Leading set in parent of PDEForm element.

**Parameters**

- `form` (`IN PDEForm`): IN A form XObject object.

**Returns:** [`ASDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble)

**See also:** [`PDEFormSetLeading`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormSetLeading)

#### PDEFormGetMatrix

```cpp
void PDEFormGetMatrix(IN PDEForm form, OUT ASFixedMatrixP matrixP)
```

Header: `PEWProcs.h:2769`

Superseded by PDEFormGetMatrixEx() in Acrobat 10.0. Gets the matrix for a PDEform. The result is a concatenation of the CTM and the Cos level form matrix, resulting in the transformation from the form space to the device space. **Note:** For the other elements, PDEElementGetMatrix() would give correct results.

**Parameters**

- `form` (`IN PDEForm`): The form for which the matrix is required.
- `matrixP` (`OUT ASFixedMatrixP`): The resultant matrix.

**Returns:** `void`

**See also:** `PDEElemetGetMatrix`, [`PDEFormGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetBBox), [`PDEFormGetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetMatrixEx)

#### PDEFormGetMatrixEx

```cpp
void PDEFormGetMatrixEx(IN PDEForm form, OUT ASDoubleMatrixP matrixP)
```

Header: `PEWProcs.h:3249`

Gets the matrix for a PDEform. Supersedes PDEFormGetMatrix() in Acrobat 10.0. The result is a concatenation of the CTM and the Cos level form matrix, resulting in the transformation from the form space to the device space. **Note:** For the other elements, PDEElementGetMatrixEx() would give correct results.

**Parameters**

- `form` (`IN PDEForm`): The form for which the matrix is required.
- `matrixP` (`OUT ASDoubleMatrixP`): The resultant matrix.

**Returns:** `void`

**See also:** `PDEElemetGetMatrix`, [`PDEFormGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetBBox), [`PDEFormGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetMatrix)

#### PDEFormHasXGroup

```cpp
ASBool PDEFormHasXGroup(IN PDEForm pdeForm)
```

Header: `PERProcs.h:2010`

Determines whether the XObject form has a Transparency XGroup

**Parameters**

- `pdeForm` (`IN PDEForm`): IN/OUT The form.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if the XObject form has a Transparency XGroup.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEFormIsLeadingSet

```cpp
ASBool PDEFormIsLeadingSet(IN PDEForm form)
```

Header: `PERProcs.h:3472`

Returns whether text leading is set in parent of PDEForm element or not.

**Parameters**

- `form` (`IN PDEForm`): IN A form XObject object.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

**See also:** [`PDEFormSetLeading`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormSetLeading), [`PDEFormGetLeading`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetLeading)

#### PDEFormSetContent

```cpp
void PDEFormSetContent(IN PDEForm form, IN PDEContent content)
```

Header: `PEWProcs.h:2574`

Sets the underlying CosStream of the form using the specified content object.

**Parameters**

- `form` (`IN PDEForm`): The form whose content is set.
- `content` (`IN PDEContent`): The new content for `form`.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `peErrPStackUnderflow`

**See also:** [`PDEFormGetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetContent)

#### PDEFormSetContentToCosObjFlags

```cpp
void PDEFormSetContentToCosObjFlags(IN PDEForm form, IN ASUns32 flags)
```

Header: `PEWProcs.h:3232`

Sets the `PDEContentToCosObjFlags` for this form.

**Parameters**

- `form` (`IN PDEForm`)
- `flags` (`IN ASUns32`)

**Returns:** `void`

**Exceptions**

- `genErrBadParm`

#### PDEFormSetLeading

```cpp
void PDEFormSetLeading(IN PDEForm form, IN ASDouble Leading)
```

Header: `PEWProcs.h:3848`

Sets the Leading in parent of PDEForm element before form emit.

**Parameters**

- `form` (`IN PDEForm`): IN A form XObject object.
- `Leading` (`IN ASDouble`)

**Returns:** `void`

**See also:** [`PDEFormGetLeading`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetLeading)

#### PDEFormSetXGroup

```cpp
void PDEFormSetXGroup(IN PDEForm pdeForm, IN PDEXGroup pdeXGroup)
```

Header: `PEWProcs.h:1814`

Sets the transparency group dictionary of the form XObject.

**Parameters**

- `pdeForm` (`IN PDEForm`): IN/OUT The font XObject.
- `pdeXGroup` (`IN PDEXGroup`): IN/OUT The transparency dictionary.

**Returns:** `void`

### Structures (1)

#### PDEForm

```cpp
typedef struct _t_PDEForm* PDEForm
```

Header: `PEExpT.h:202`

A PDEElement that corresponds to an instance of an XObject Form on a page (or another containing stream such as another XObject Form or annotation form). The context associated with this instance includes the actual CosObj stream that represents the XObject Form and the initial conditions of the graphics state. The latter consists of the transformation matrix, initial color values, and so forth. It is possible to have two PDEForm objects that refer to the same XObject Form. The forms will exist at different places on the same page, depending on the transformation matrix. They may also have different colors or line stroking parameters. In the case of a transparency group, the opacity is specified in the `gstate`. Within a PDEForm, each PDEElement has its own `gstate` (or is a container, place, or group object). These `gstates` are independent of the parent PDEForm `gstate`. PDEForm elements within the PDEForm may have their own opacity. A PDEContent may be obtained from a PDEForm to edit the form's display list.

**See also:** `PDEElement (superclass)`, [`PDEFormCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormCreateFromCosObj), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

## PDEGraphicFont

### Structures (1)

#### PDEGraphicFont

```cpp
typedef struct _t_PDEGraphicFont* PDEGraphicFont
```

Header: `PEExpT.h:430`

## PDEGroup

### Functions (3)

#### PDEGroupCreate

```cpp
PDEGroup PDEGroupCreate(void)
```

Header: `PEWProcs.h:1481`

Creates a PDEGroup object. Call PDERelease() to dispose of the returned PDEGroup object when finished with it.

**Parameters**

- (unnamed) (`void`)

**Returns:** [`PDEGroup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEGroup)

The newly created PDEGroup.

**See also:** [`PDEGroupSetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEGroupSetContent)

#### PDEGroupGetContent

```cpp
PDEContent PDEGroupGetContent(IN PDEGroup pdeGroup)
```

Header: `PERProcs.h:1634`

Gets the PDEContent for a PDEGroup. **Note:** This method does not change the reference count of the returned PDEContent.

**Parameters**

- `pdeGroup` (`IN PDEGroup`): IN/OUT The group whose content is obtained.

**Returns:** [`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent)

The PDEContent in `pdeGroup`.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEGroupSetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEGroupSetContent)

#### PDEGroupSetContent

```cpp
void PDEGroupSetContent(IN PDEGroup pdeGroup, IN PDEContent pdeContent)
```

Header: `PEWProcs.h:1496`

Sets the PDEContent for a PDEGroup. The existing PDEContent is released by this method. **Note:** This method increments the reference count of `pdeContent`.

**Parameters**

- `pdeGroup` (`IN PDEGroup`): IN/OUT A container object.
- `pdeContent` (`IN PDEContent`): IN/OUT The content to set for `pdeGroup`.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEGroupGetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEGroupGetContent)

### Structures (1)

#### PDEGroup

```cpp
typedef struct _t_PDEGroup* PDEGroup
```

Header: `PEExpT.h:257`

An in-memory representation of objects in a PDEContent object. It has no state and is not represented in any way in a PDF content stream (that is, PDEContent). When used in a PDEClip, this object is used to associate PDEText objects into a single clipping object.

**See also:** `PDEElement (superclass)`, [`PDEGroupCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEGroupCreate)

## PDEImage

### Functions (32)

#### PDEImageAcquireImageFlate

```cpp
PDEImageFlate PDEImageAcquireImageFlate(IN PDEImage image)
```

Header: `PERProcs.h:2663`

Acquires the PDEImageFlate resource of the PDEImage content element when the image filter type is `"FlateDecode"`, or `0` if it is not. Call PDERelease() to dispose of the PDEImageFlate when finished with it.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The PDEImage object.

**Returns:** [`PDEImageFlate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageFlate)

a PDEImageFlate resource object.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEImageAcquireImageJPX

```cpp
PDEImageJPX PDEImageAcquireImageJPX(IN PDEImage image)
```

Header: `PERProcs.h:2675`

Acquires the PDEImageJPX resource of the PDEImage content element when the image filter type is `"JPXDecode"`, or `0` if it is not. Call PDERelease() to dispose of the PDEImageJPX when finished with it.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The PDEImage object.

**Returns:** [`PDEImageJPX`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPX)

a PDEImageJPX resource object.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEImageCreate

```cpp
PDEImage PDEImageCreate(IN PDEImageAttrsP attrsP, IN ASUns32 attrsSize, IN ASFixedMatrixP matrixP, IN ASUns32 flags, IN PDEColorSpace colorSpace, IN PDEColorValueP colorValueP, IN PDEFilterArrayP filtersP, IN ASStm dataStm, IN ASUns8 *data, IN ASUns32 encodedLen)
```

Header: `PEWProcs.h:591`

Superseded by PDEImageCreateEx() in Acrobat 10.0. Creates an image object. The image data may be specified as a stream or as a buffer. If `data` is non-`NULL`, `dataStm` is ignored. See PDEImageSetDataStm() for information on handling the stream. The caller must dispose of `dataStm` after calling this method. Call PDERelease() to dispose of the returned image object when finished with it.

**Parameters**

- `attrsP` (`IN PDEImageAttrsP`): IN/OUT A pointer to a PDEImageAttrs object with attributes of the image.
- `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes.
- `matrixP` (`IN ASFixedMatrixP`): IN/OUT A pointer to an `ASFixedMatrix` that holds the transformation matrix to use for the image.
- `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, and the data is provided directly (not as a stream), then `encodedLen` must specify the length of data.
- `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space of the image. When the image is an image mask, `colorSpace` is the color space of the `colorValueP` argument.
- `colorValueP` (`IN PDEColorValueP`): IN/OUT A pointer to a `PDEColorValue` structure. If the image is an image mask, `colorValueP` must be provided.
- `filtersP` (`IN PDEFilterArrayP`): IN/OUT A pointer to a `PDEFilterArray` structure that specifies which filters to use in encoding the contents; it may be `NULL`. Filters will be used to encode the data in the order in which they are specified in the array.
- `dataStm` (`IN ASStm`): IN/OUT The stream holding the image data.
- `data` (`IN ASUns8 *`): IN/OUT The image data. If `data` is non-`NULL`, `dataStm` is ignored. If there is a great deal of data, as for a large image, it is recommended you use the `dataStm` parameter for the image data or use the PDEImageCreateFromCosObj() method.
- `encodedLen` (`IN ASUns32`): IN/OUT The encoded length of `data` in bytes.

**Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)

The image.

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `pageErrReadLessImageData`
- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEImageCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObj), [`PDEImageCreateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateEx)

#### PDEImageCreateEx

```cpp
PDEImage PDEImageCreateEx(IN PDEImageAttrsP attrsP, IN ASUns32 attrsSize, IN ASDoubleMatrixP matrixP, IN ASUns32 flags, IN PDEColorSpace colorSpace, IN PDEColorValueP colorValueP, IN PDEFilterArrayP filtersP, IN ASStm dataStm, IN ASUns8 *data, IN ASUns64 encodedLen)
```

Header: `PEWProcs.h:3412`

Creates an image object. Supersedes PDEImageCreate() in Acrobat 10.0. The image data may be specified as a stream or as a buffer. If `dataStm` is non-`NULL`, `data` is ignored. See PDEImageSetDataStm() for information on handling the stream. The caller must dispose of `dataStm` after calling this method. Call PDERelease() to dispose of the returned image object when finished with it.

**Parameters**

- `attrsP` (`IN PDEImageAttrsP`): IN/OUT A pointer to a PDEImageAttrs object with attributes of the image.
- `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes.
- `matrixP` (`IN ASDoubleMatrixP`): IN/OUT A pointer to an `ASDoubleMatrix` that holds the transformation matrix to use for the image.
- `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, and the data is provided directly (not as a stream), then `encodedLen` must specify the length of data.
- `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space of the image. When the image is an image mask, `colorSpace` is the color space of the `colorValueP` argument.
- `colorValueP` (`IN PDEColorValueP`): IN/OUT A pointer to a `PDEColorValue` structure. If the image is an image mask, `colorValueP` must be provided.
- `filtersP` (`IN PDEFilterArrayP`): IN/OUT A pointer to a `PDEFilterArray` structure that specifies which filters to use in encoding the contents; it may be `NULL`. Filters will be used to encode the data in the order in which they are specified in the array.
- `dataStm` (`IN ASStm`): IN/OUT The stream holding the image data.
- `data` (`IN ASUns8 *`): IN/OUT The image data. If `dataStm` is non-`NULL`, `data` is ignored. If there is a great deal of data, as for a large image, it is recommended you use the `dataStm` parameter for the image data or use the PDEImageCreateFromCosObjEx() method.
- `encodedLen` (`IN ASUns64`): IN/OUT The encoded length of `data` in bytes.

**Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)

The image.

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `pageErrReadLessImageData`
- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEImageCreateFromCosObjEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObjEx), [`PDEImageCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreate)

#### PDEImageCreateFromCosObj

```cpp
PDEImage PDEImageCreateFromCosObj(IN const CosObj *imageObjP, IN ASFixedMatrixP matrixP, IN PDEColorSpace colorSpace, IN PDEColorValueP colorValueP)
```

Header: `PEWProcs.h:621`

Superseded by PDEImageCreateFromCosObjEx() in Acrobat 10.0. Creates an image object from a Cos object. Call PDERelease() to dispose of the returned image object when finished with it.

**Parameters**

- `imageObjP` (`IN const CosObj *`): IN/OUT The Cos object for the image.
- `matrixP` (`IN ASFixedMatrixP`): IN/OUT A pointer to an `ASFixedMatrix` that holds the transformation matrix to use for the image.
- `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space used for the image, if the image is an image mask; otherwise, set it to `NULL`.
- `colorValueP` (`IN PDEColorValueP`): IN/OUT A pointer to a `PDEColorValue` structure. If the image is an image mask, `colorValueP` must be provided.

**Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)

An image corresponding to the Cos object.

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `pageErrReadLessImageData`
- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEImageCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreate), [`PDEImageGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetCosObj), [`PDEImageCreateFromCosObjEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObjEx)

#### PDEImageCreateFromCosObjEx

```cpp
PDEImage PDEImageCreateFromCosObjEx(IN const CosObj *imageObjP, IN ASDoubleMatrixP matrixP, IN PDEColorSpace colorSpace, IN PDEColorValueP colorValueP)
```

Header: `PEWProcs.h:3480`

Creates an image object from a Cos object. Supersedes PDEImageCreateFromCosObj() in Acrobat 10.0. Call PDERelease() to dispose of the returned image object when finished with it.

**Parameters**

- `imageObjP` (`IN const CosObj *`): IN/OUT The Cos object for the image.
- `matrixP` (`IN ASDoubleMatrixP`): IN/OUT A pointer to an `ASDoubleMatrix` that holds the transformation matrix to use for the image.
- `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space used for the image, if the image is an image mask; otherwise, set it to `NULL`.
- `colorValueP` (`IN PDEColorValueP`): IN/OUT A pointer to a `PDEColorValue` structure. If the image is an image mask, `colorValueP` must be provided.

**Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)

An image corresponding to the Cos object.

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `pageErrReadLessImageData`
- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEImageCreateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateEx), [`PDEImageGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetCosObj), [`PDEImageCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObj)

#### PDEImageCreateInCosDoc

```cpp
PDEImage PDEImageCreateInCosDoc(IN PDEImageAttrsP attrsP, IN ASUns32 attrsSize, IN ASFixedMatrixP matrixP, IN ASUns32 flags, IN PDEColorSpace colorSpace, IN PDEColorValueP colorValueP, IN PDEFilterArrayP filtersP, IN ASStm dataStm, IN ASUns8 *data, IN ASUns32 encodedLen, IN CosDoc cosDoc)
```

Header: `PEWProcs.h:2842`

Superseded by PDEImageCreateInCosDocEx() in Acrobat 10.0. Creates an image object like PDEImageCreate(), except that the client can specify the CosDoc in which the image is created. The image data may be specified as a stream or as a buffer. If `data` is non-`NULL`, `dataStm` is ignored. See PDEImageSetDataStm() for information on handling the stream. The caller must dispose of `dataStm` after calling this method. Call PDERelease() to dispose of the returned image object when finished with it.

**Parameters**

- `attrsP` (`IN PDEImageAttrsP`): IN/OUT A pointer to a PDEImageAttrs object with attributes of the image.
- `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes.
- `matrixP` (`IN ASFixedMatrixP`): IN/OUT A pointer to an `ASFixedMatrix` that holds the transformation matrix to use for the image.
- `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, and the data is provided directly (not as a stream), then `encodedLen` must specify the length of data.
- `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space of the image. When the image is an image mask, `colorSpace` is the color space of the `colorValueP` argument.
- `colorValueP` (`IN PDEColorValueP`): IN/OUT A pointer to a `PDEColorValue` structure. If the image is an image mask, `colorValueP` must be provided.
- `filtersP` (`IN PDEFilterArrayP`): IN/OUT A pointer to a `PDEFilterArray` structure that specifies which filters to use in encoding the contents; it may be `NULL`. Filters will be used to encode the data in the order in which they are specified in the array.
- `dataStm` (`IN ASStm`): IN/OUT The stream holding the image data.
- `data` (`IN ASUns8 *`): IN/OUT The image data. If `data` is non-`NULL`, `dataStm` is ignored. If there is a great deal of data, as for a large image, it is recommended you use the `dataStm` parameter for the image data or use the PDEImageCreateFromCosObj() method.
- `encodedLen` (`IN ASUns32`): IN/OUT The encoded length of `data` in bytes.
- `cosDoc` (`IN CosDoc`): IN/OUT Document in which to put Cos representation of resource. May be NULL.

**Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)

The image.

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `pageErrReadLessImageData`
- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEImageCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObj), [`PDEImageCreateInCosDocEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateInCosDocEx)

#### PDEImageCreateInCosDoc64

```cpp
PDEImage PDEImageCreateInCosDoc64(IN PDEImageAttrsP attrsP, IN ASUns32 attrsSize, IN ASFixedMatrixP matrixP, IN ASUns32 flags, IN PDEColorSpace colorSpace, IN PDEColorValueP colorValueP, IN PDEFilterArrayP filtersP, IN ASStm dataStm, IN ASUns8 *data, IN ASUns64 encodedLen, IN CosDoc cosDoc)
```

Header: `PEWProcs.h:3212`

Superseded by PDEImageCreateInCosDocEx() in Acrobat 10.0. Creates an image object like PDEImageCreateInCosDoc(), except that the client can create an image with a large amount of data. The image data may be specified as a stream or as a buffer. If `data` is non-`NULL`, `dataStm` is ignored. See PDEImageSetDataStm() for information on handling the stream. The caller must dispose of `dataStm` after calling this method. Call PDERelease() to dispose of the returned image object when finished with it.

**Parameters**

- `attrsP` (`IN PDEImageAttrsP`): IN/OUT A pointer to a PDEImageAttrs object with attributes of the image.
- `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes.
- `matrixP` (`IN ASFixedMatrixP`): IN/OUT A pointer to an `ASFixedMatrix` that holds the transformation matrix to use for the image.
- `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, and the data is provided directly (not as a stream), then `encodedLen` must specify the length of data.
- `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space of the image. When the image is an image mask, `colorSpace` is the color space of the `colorValueP` argument.
- `colorValueP` (`IN PDEColorValueP`): IN/OUT A pointer to a `PDEColorValue` structure. If the image is an image mask, `colorValueP` must be provided.
- `filtersP` (`IN PDEFilterArrayP`): IN/OUT A pointer to a `PDEFilterArray` structure that specifies which filters to use in encoding the contents; it may be `NULL`. Filters will be used to encode the data in the order in which they are specified in the array.
- `dataStm` (`IN ASStm`): IN/OUT The stream holding the image data.
- `data` (`IN ASUns8 *`): IN/OUT The image data. If `data` is non-`NULL`, `dataStm` is ignored. If there is a great deal of data, as for a large image, it is recommended you use the `dataStm` parameter for the image data or use the PDEImageCreateFromCosObj() method.
- `encodedLen` (`IN ASUns64`): IN/OUT The encoded length of `data` in bytes.
- `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of the resource. It may be `NULL`.

**Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)

The image.

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `pageErrReadLessImageData`
- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEImageCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObj), [`PDEImageCreateInCosDocEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateInCosDocEx)

#### PDEImageCreateInCosDocEx

```cpp
PDEImage PDEImageCreateInCosDocEx(IN PDEImageAttrsP attrsP, IN ASUns32 attrsSize, IN ASDoubleMatrixP matrixP, IN ASUns32 flags, IN PDEColorSpace colorSpace, IN PDEColorValueP colorValueP, IN PDEFilterArrayP filtersP, IN ASStm dataStm, IN ASUns8 *data, IN ASUns64 encodedLen, IN CosDoc cosDoc)
```

Header: `PEWProcs.h:3357`

Creates an image object like PDEImageCreateInCosDoc(), except that the client can create an image with a large amount of data, and using a double precision transformation matrix. Supersedes PDEImageCreateInCosDoc() and PDEImageCreateInCosDoc64() in Acrobat 10.0. The image data may be specified as a stream or as a buffer. If `dataStm` is non-`NULL`, `data` is ignored. See PDEImageSetDataStm() for information on handling the stream. The caller must dispose of `dataStm` after calling this method. Call PDERelease() to dispose of the returned image object when finished with it.

**Parameters**

- `attrsP` (`IN PDEImageAttrsP`): IN/OUT A pointer to a PDEImageAttrs object with attributes of the image.
- `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes.
- `matrixP` (`IN ASDoubleMatrixP`): IN/OUT A pointer to an `ASDoubleMatrix` that holds the transformation matrix to use for the image.
- `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, and the data is provided directly (not as a stream), then `encodedLen` must specify the length of data.
- `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space of the image. When the image is an image mask, `colorSpace` is the color space of the `colorValueP` argument.
- `colorValueP` (`IN PDEColorValueP`): IN/OUT A pointer to a `PDEColorValue` structure. If the image is an image mask, `colorValueP` must be provided.
- `filtersP` (`IN PDEFilterArrayP`): IN/OUT A pointer to a `PDEFilterArray` structure that specifies which filters to use in encoding the contents; it may be `NULL`. Filters will be used to encode the data in the order in which they are specified in the array.
- `dataStm` (`IN ASStm`): IN/OUT The stream holding the image data.
- `data` (`IN ASUns8 *`): IN/OUT The image data. If `dataStm` is non-`NULL`, `data` is ignored. If there is a great deal of data, as for a large image, it is recommended you use the `dataStm` parameter for the image data or use the PDEImageCreateFromCosObjEx() method.
- `encodedLen` (`IN ASUns64`): IN/OUT The encoded length of `data` in bytes.
- `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of the resource. It may be `NULL`.

**Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)

The image.

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `pageErrReadLessImageData`
- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEImageCreateFromCosObjEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObjEx), [`PDEImageCreateInCosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateInCosDoc), [`PDEImageCreateInCosDoc64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateInCosDoc64)

#### PDEImageDataIsEncoded

```cpp
ASBool PDEImageDataIsEncoded(IN PDEImage image, OUT ASUns32 *encodedLenP)
```

Header: `PERProcs.h:818`

Determines if image data is encoded or not. It is used only for inline images; it is not relevant to XObject images. It always returns `false` for XObject images; XObject image data can be obtained from PDEImageGetData() or PDEImageGetDataStm(), either encoded or decoded. If an inline image is obtained via PDEContentCreateFromCosObj() or related methods, the inline image data is always decoded. That is, if PDFEdit parses the stream, the data is always decoded. Only if PDEImageCreate() is used to explicitly create a new image using encoded data does PDEImageDataIsEncoded() return `true`.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image to examine.
- `encodedLenP` (`OUT ASUns32 *`): IN/OUT (Filled by the method) The length of the
  encoded data. If the data is encoded, the method
  returns `true`.`true` if PDEImageGetData returns encoded data, `false`
  otherwise. It returns `false` for XObject images.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData)

#### PDEImageGetAttrs

```cpp
void PDEImageGetAttrs(IN PDEImage image, IN PDEImageAttrsP attrsP, IN ASUns32 attrsSize)
```

Header: `PERProcs.h:758`

Gets the attributes for an image.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image whose attributes are obtained.
- `attrsP` (`IN PDEImageAttrsP`): IN/OUT (Filled by the method) A pointer to a PDEImageAttrs structure with attributes of image.
- `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrUnknownPDEColorSpace`

**See also:** [`PDEImageGetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpace), [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData), [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen), [`PDEImageGetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataStm), [`PDEImageGetDecodeArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDecodeArray), [`PDEImageGetFilterArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetFilterArray)

#### PDEImageGetColorSpace

```cpp
PDEColorSpace PDEImageGetColorSpace(IN PDEImage image)
```

Header: `PERProcs.h:778`

Gets the color space object for an image.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image whose color space is obtained.

**Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace)

**See also:** [`PDEImageGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetAttrs), [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData), [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen), [`PDEImageGetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataStm), [`PDEImageGetDecodeArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDecodeArray), [`PDEImageGetFilterArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetFilterArray)

#### PDEImageGetColorSpaceEx

```cpp
PDEColorSpace PDEImageGetColorSpaceEx(IN PDEImage image, IN ASUns32 flags)
```

Header: `PERProcs.h:2992`

Retrieves a `PDEImage` object's color space, in the desired bits per component, based on the `flags` parameter.

**Parameters**

- `image` (`IN PDEImage`): IN The `PDEImage` instance whose color space is desired.
- `flags` (`IN ASUns32`): IN A set of flags to specify the desired bits per component (bpc) of the returned color space.

**Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace)

**See also:** [`PDEImageGetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpace), [`PDEImageColorSpaceFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageColorSpaceFlags)

#### PDEImageGetCosObj

```cpp
void PDEImageGetCosObj(IN PDEImage image, OUT CosObj *cosObjP)
```

Header: `PERProcs.h:917`

Gets a Cos object for an image.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image whose Cos object is obtained.
- `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the image.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObj), [`PDEImageIsCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageIsCosObj)

#### PDEImageGetData

```cpp
void PDEImageGetData(IN PDEImage image, IN ASUns32 flags, IN ASUns8 *buffer)
```

Header: `PERProcs.h:850`

Gets an image's data. If the image is an XObject image, data is always returned as decoded data. See the note about inline images under PDEImageDataIsEncoded().

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image whose data is obtained.
- `flags` (`IN ASUns32`): IN/OUT Unused - must be zero.
- `buffer` (`IN ASUns8 *`): IN/OUT The image data. If the data is decoded, `buffer` must be large enough to contain the number of bytes specified in the PDEImageAttrs structure obtained by PDEImageGetAttrs(). If the data is encoded, `buffer` must be large enough to contain the number of bytes in the `encodedLenP` parameter obtained by PDEImageDataIsEncoded().

**Returns:** `void`

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `genErrBadParm`
- `peErrWrongPDEObjectType`

**See also:** [`PDEImageDataIsEncoded`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageDataIsEncoded), [`PDEImageSetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageSetColorSpace), [`PDEImageGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetAttrs), [`PDEImageGetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpace), [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen), [`PDEImageGetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataStm), [`PDEImageGetDecodeArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDecodeArray), [`PDEImageGetFilterArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetFilterArray)

#### PDEImageGetDataLen

```cpp
ASInt32 PDEImageGetDataLen(IN PDEImage image)
```

Header: `PERProcs.h:885`

Gets the length of data for an image.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image whose data length is obtained.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The number of bytes of image data, specified by the width, height, bits per component, and color space of the image.

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `genErrBadParm`
- `peErrWrongPDEObjectType`

**See also:** [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData)

#### PDEImageGetDataLen64

```cpp
ASInt64 PDEImageGetDataLen64(IN PDEImage image)
```

Header: `PEWProcs.h:3151`

Gets the length of data for an image.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image whose data length is obtained.

**Returns:** [`ASInt64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt64)

The number of bytes of image data, specified by the width, height, bits per component, and color space of the image. Clients should switch to this routine. PDEImageGetDataLen() will raise an error if it encounters an image with a length that is larger than `2^31 - 1`.

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `genErrBadParm`
- `peErrWrongPDEObjectType`

**See also:** [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen)

#### PDEImageGetDataStm

```cpp
ASStm PDEImageGetDataStm(IN PDEImage image, IN ASUns32 flags)
```

Header: `PERProcs.h:871`

Gets a data stream for an image. It may only be called for XObject images. The caller must dispose of the returned ASStm by calling ASStmClose.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image whose data stream is obtained.
- `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, data is returned in encoded form. Otherwise, data is decoded.

**Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)

The stream for the image.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEImageSetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageSetDataStm), [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen)

#### PDEImageGetDecodeArray

```cpp
ASUns32 PDEImageGetDecodeArray(IN PDEImage image, OUT ASFixed *decode, IN ASUns32 decodeSize)
```

Header: `PERProcs.h:1850`

Gets the decode array from the attributes of the image. This array specifies the parameters used with the array of filters used to decode the image. This should be called first with a `NULL` `decode` to obtain the number of elements that may be returned so that a properly sized array can be allocated for a subsequent call. There are two decode entries per colorant in normal use.

**Parameters**

- `image` (`IN PDEImage`): The image whose decode array is obtained.
- `decode` (`OUT ASFixed *`): (Filled by the method) A pointer to the `decode` array. If it is `NULL`, the number of `decode` elements required is returned.
- `decodeSize` (`IN ASUns32`): The number of elements in `decode`.

**Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)

The number of elements in the `decode` array.

**See also:** [`PDEImageSetDecodeArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageSetDecodeArray)

#### PDEImageGetFilterArray

```cpp
ASInt32 PDEImageGetFilterArray(IN PDEImage image, OUT PDEFilterArrayP filtersP)
```

Header: `PERProcs.h:904`

Gets the filter array for an image.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image whose filter array is obtained.
- `filtersP` (`OUT PDEFilterArrayP`): IN/OUT (Filled by the method) A pointer to `PDEFilterArray` structure to fill with the current filter array for the image. `filtersP` must be large enough to contain all of the elements. It may be `NULL` to obtain the number of filter elements.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The number of filter elements.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetAttrs), [`PDEImageGetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpace), [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen), [`PDEImageGetDecodeArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDecodeArray)

#### PDEImageGetMatteArray

```cpp
ASUns32 PDEImageGetMatteArray(IN PDEImage image, OUT ASFixed *matte, IN ASUns32 numComp)
```

Header: `PERProcs.h:2204`

Gets the matte array for the image XObject.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image XObject.
- `matte` (`OUT ASFixed *`): IN/OUT (Filled by the method) An array of values.
- `numComp` (`IN ASUns32`): IN/OUT The number of values in `matte`.

**Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)

The number of values copied.

#### PDEImageGetSMask

```cpp
PDEImage PDEImageGetSMask(IN PDEImage image)
```

Header: `PERProcs.h:2192`

Gets the soft mask for an image. Use PDERelease() to dispose of the object when it is no longer referenced.

**Parameters**

- `image` (`IN PDEImage`): An object of type PDEImage.

**Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)

An object of type PDEImage.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEImageGetType

```cpp
ASAtom PDEImageGetType(IN PDEImage image)
```

Header: `PERProcs.h:2651`

Returns the type of image as `"FlateDecode"`, `"JPXDecode"`, or `"Unknown"` when the image filter is not one of these types.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The PDEImage object.

**Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)

See above.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEImageHasSMask

```cpp
ASBool PDEImageHasSMask(IN PDEImage image)
```

Header: `PERProcs.h:2182`

Checks whether the image has a soft mask.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT An object of type PDEImage.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if the soft mask exists, `false` otherwise.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEImageIsCosObj

```cpp
ASBool PDEImageIsCosObj(IN PDEImage image)
```

Header: `PERProcs.h:790`

Determines if an image is an XObject image.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image to examine.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if the image is an XObject image, `false` otherwise.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetCosObj)

#### PDEImageSetColorSpace

```cpp
void PDEImageSetColorSpace(IN PDEImage image, IN PDEColorSpace space)
```

Header: `PEWProcs.h:2227`

Sets the color space of the image.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image whose color space is obtained.
- `space` (`IN PDEColorSpace`): IN/OUT An object of type PDEColorSpace.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageGetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpace), [`PDEImageSetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageSetColorSpace)

#### PDEImageSetColorValue

```cpp
void PDEImageSetColorValue(IN PDEImage image, IN PDEColorValueP color)
```

Header: `PERProcs.h:3379`

Sets an image's Color Value. This call is valid only for a PDEImage which is an Image Mask

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image whose data is set.
- `color` (`IN PDEColorValueP`)

**Returns:** `void`

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `genErrBadParm`
- `peErrWrongPDEObjectType`

#### PDEImageSetData

```cpp
void PDEImageSetData(IN PDEImage image, IN ASUns32 flags, IN ASUns8 *buffer, IN ASUns32 encodedLen)
```

Header: `PEWProcs.h:507`

Sets data for an image.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image whose data is set.
- `flags` (`IN ASUns32`): IN/OUT A set of PDEImageDataFlags flags. If kPDEImageEncodedData is set, the data must be encoded for the current filters, and `encodedLen` is the length of the encoded data. If the kPDEImageEncodedData flag is not set, data is not encoded and `encodedLen` is the size of the decoded data.
- `buffer` (`IN ASUns8 *`): IN/OUT The image data.
- `encodedLen` (`IN ASUns32`): IN/OUT The length of the encoded data.

**Returns:** `void`

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `genErrBadParm`
- `peErrWrongPDEObjectType`

**See also:** [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData), [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen), [`PDEImageGetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataStm)

#### PDEImageSetDataStm

```cpp
void PDEImageSetDataStm(IN PDEImage image, IN ASUns32 flags, IN PDEFilterArrayP filtersP, IN ASStm stm)
```

Header: `PEWProcs.h:538`

Sets a data stream for an image. It can only be used for XObject images. The caller must dispose of the stream by calling ASStmClose().

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image whose data stream is set.
- `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, the stream must be encoded.
- `filtersP` (`IN PDEFilterArrayP`): IN/OUT A pointer to a `PDEFilterArray` structure. If it is not `NULL`, it is used to build Cos objects for the Filter, DecodeParms, and EncodeParms objects. If `filtersP` is `NULL` and `kPDEImageEncodedData` is set in `flags`, the existing Filter and DecodeParms are used. If `kPDEImageEncodedData` is not set and `filtersP` is `NULL`, the existing Cos objects (if any) for Filter and DecodeParms are removed and the resulting image is no longer compressed. EncodeParms is set it to DecodeParms if it exists (unless the filter is DCTDecode, for which EncodeParms is mandatory).
- `stm` (`IN ASStm`): IN/OUT The stream for the image data.

**Returns:** `void`

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData), [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen), [`PDEImageGetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataStm)

#### PDEImageSetDecodeArray

```cpp
void PDEImageSetDecodeArray(IN PDEImage image, IN ASFixed *decode, IN ASUns32 decodeSize)
```

Header: `PEWProcs.h:1572`

Sets the decode array of an image. Normally, the decode array is accessed through the `decode` field in the PDEImageAttrs structure. However, this method defines a decode array to handle images with a color space that has more than four components.

**Parameters**

- `image` (`IN PDEImage`): The image whose decode array is set.
- `decode` (`IN ASFixed *`): A pointer to the decode array.
- `decodeSize` (`IN ASUns32`): The number of elements in the decode array.

**Returns:** `void`

**See also:** [`PDEImageGetDecodeArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDecodeArray), [`PDEImageGetFilterArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetFilterArray)

#### PDEImageSetMatteArray

```cpp
void PDEImageSetMatteArray(IN PDEImage image, IN ASFixed *matte, IN ASUns32 numComp)
```

Header: `PEWProcs.h:1978`

Sets the matte array for the image XObject.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image XObject.
- `matte` (`IN ASFixed *`): IN/OUT An array of values.
- `numComp` (`IN ASUns32`): IN/OUT The number of values in mArray.

**Returns:** `void`

#### PDEImageSetSMask

```cpp
void PDEImageSetSMask(IN PDEImage image, IN PDEImage sMask)
```

Header: `PEWProcs.h:1968`

Sets the soft mask.

**Parameters**

- `image` (`IN PDEImage`): IN/OUT The image XObject.
- `sMask` (`IN PDEImage`): IN/OUT The soft mask.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

### Structures (2)

#### PDEImage

```cpp
typedef struct _t_PDEImage* PDEImage
```

Header: `PEExpT.h:183`

A PDEElement that contains an Image XObject or an inline image. You can associate data or a stream with an image.

**See also:** `PDEElement (superclass)`, [`PDEImageCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreate), [`PDEImageCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObj), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

#### PDEImageAttrsP

```cpp
typedef struct PDEImageAttrs * PDEImageAttrsP
```

Header: `PEExpT.h:930`

### Enums (3)

#### PDEImageAttrFlags

Header: `PEExpT.h:1872`

Flags for PDEImageAttrs. See the description of image attributes in "Image Dictionaries" in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.9.5, page 206. You can find this document on the web store of the International Standards Organization (ISO).

**Values**

- `kPDEImageExternal = 0x0001`: The image is an XObject.
- `kPDEImageIsMask = 0x0002`: The image is an imagemask.
- `kPDEImageInterpolate = 0x0004`: `interpolate` is `true`.
- `kPDEImageHaveDecode = 0x0008`: The image has a decode array.
- `kPDEImageIsIndexed = 0x0010`: The image uses an indexed color space.
- `kPDEImageMaskedByPosition = 0x0020`: The image has a Mask key containing an ImageMask stream.
- `kPDEImageMaskedByColor = 0x0040`: The image has a Mask key containing an array of color values.

**See also:** [`PDEImageCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreate), [`PDEImageGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetAttrs), [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData)

#### PDEImageColorSpaceFlags

Header: `PEExpT.h:1921`

Flags to enable `PDEImageGetColorSpaceEx()` to return a color space with a particular bpc, depending on the image's bpc.

**Values**

- `kPDEImageConvert16bpcColorSpace = 0x0001`: Indicates conversion of the color space of 16 bpc image to 8 bpc.

**See also:** [`PDEImageGetColorSpaceEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpaceEx), [`PDEImageGetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpace)

#### PDEImageDataFlags

Header: `PEExpT.h:1904`

Flags for `PDEImageGetData()`, `PDEImageGetDataStm()`, `PDEImageSetData()`, and `PDEImageSetDataStm()`.

**Values**

- `kPDEImageEncodedData = 0x0001`: Indicates that the filter is active; data is encoded.
- `kPDEImageAllowDelayedRead = 0x0002`
- `kPDEImage16bpcData = 0x0004`: Indicates if the accompanying image data is 16-bit. Should be passed in for 16-bit images to PDEImageGetData/PDEImageGetDataStm to prevent the return of 8-bit converted data.

**See also:** [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData), [`PDEImageGetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataStm), [`PDEImageSetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageSetData), [`PDEImageSetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageSetDataStm), [`PDEImageCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreate)

## PDEImageFlate

### Functions (4)

#### PDEImageFlateAcquireColorSpace

```cpp
PDEColorSpace PDEImageFlateAcquireColorSpace(IN PDEImageFlate imgFlate)
```

Header: `PERProcs.h:2725`

Acquires the color space of the flate image. PDERelease should be used to release the color space when it is no longer referenced by the caller.

**Parameters**

- `imgFlate` (`IN PDEImageFlate`): IN/OUT An object of type PDEImageFlate.

**Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace)

The color space of the flate image; otherwise it returns `NULL`.

**See also:** [`PDEImageGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetType), [`PDEImageAcquireImageFlate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageAcquireImageFlate)

#### PDEImageFlateGetAttrs

```cpp
void PDEImageFlateGetAttrs(IN PDEImageFlate imgFlate, OUT PDEImageFlateAttrsP attrsP, IN ASUns32 attrsSize)
```

Header: `PERProcs.h:2713`

Gets the attributes of a flate image.

**Parameters**

- `imgFlate` (`IN PDEImageFlate`): IN/OUT A flate image resource object.
- `attrsP` (`OUT PDEImageFlateAttrsP`): IN/OUT (Filled by the method) A pointer to a `PDEImageFlateAttrs` structure containing the attributes of the flate image.
- `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEImageFlateGetCosObj

```cpp
void PDEImageFlateGetCosObj(IN PDEImageFlate pdeImageFlate, OUT CosObj *cosObjP)
```

Header: `PERProcs.h:2701`

Gets a Cos object for an image.

**Parameters**

- `pdeImageFlate` (`IN PDEImageFlate`): IN/OUT The flate image whose Cos object is obtained.
- `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the image.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetType), [`PDEImageAcquireImageFlate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageAcquireImageFlate)

#### PDEImageFlateGetDataStm

```cpp
ASStm PDEImageFlateGetDataStm(IN PDEImageFlate imgFlate, IN ASUns32 flags)
```

Header: `PERProcs.h:2744`

Gets a data stream for a flate compressed image, PDEImageFlate object. The caller must dispose of the returned ASStm by calling ASStmClose().

**Parameters**

- `imgFlate` (`IN PDEImageFlate`): IN/OUT The flate image whose data stream is obtained.
- `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, data is returned in encoded form. Otherwise, data is decoded.

**Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)

The stream for the image.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEImageGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetType), [`PDEImageAcquireImageFlate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageAcquireImageFlate)

### Structures (1)

#### PDEImageFlate

```cpp
typedef struct _t_PDEImageFlate* PDEImageFlate
```

Header: `PEExpT.h:415`

A reference to a PDEImageFlate.

## PDEImageJPX

### Functions (8)

#### PDEImageJPXAcquireColorSpace

```cpp
PDEColorSpace PDEImageJPXAcquireColorSpace(IN PDEImageJPX pdeImageJPX)
```

Header: `PERProcs.h:2774`

Acquires the PDEColorSpace associated with the JPX encoded image, if one exists. If a PDF color space has not been associated with the JPX encoded image, `0` will be returned. This object is acquired and must be released using PDERelease() when it is no longer in use. @since

**Parameters**

- `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT A JPX encoded image object.

**Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace)

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetType), `PDEImageAcquireJPX`

#### PDEImageJPXAcquireJPXColorSpace

```cpp
JPXColorSpace PDEImageJPXAcquireJPXColorSpace(IN PDEImageJPX pdeImageJPX)
```

Header: `PERProcs.h:2817`

Acquires a link list of JPXColorSpace objects defined with the JPX encoded image. if one exists. This object is acquired and must be released using PDERelease() when it is no longer in use. @since

**Parameters**

- `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT A JPX encoded image object.

**Returns:** [`JPXColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXColorSpace)

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`JPXColorSpaceAcquireNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXColorSpaceAcquireNext), [`JPXColorSpaceGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXColorSpaceGetType), [`JPXColorSpaceGetEnumAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXColorSpaceGetEnumAttrs), [`JPXColorSpaceGetProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXColorSpaceGetProfile)

#### PDEImageJPXAcquirePalette

```cpp
JPXPalette PDEImageJPXAcquirePalette(IN PDEImageJPX pdeImageJPX)
```

Header: `PERProcs.h:2846`

Acquires the JPXPalette from the JPX image object This object is acquired and must be released using PDERelease() when it is no longer in use. @since

**Parameters**

- `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT A JPX encoded image object.

**Returns:** [`JPXPalette`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXPalette)

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`JPXPaletteGetNumEntries`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXPaletteGetNumEntries), [`JPXPaletteGetBitDepths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXPaletteGetBitDepths), [`JPXPaletteGetNumComponents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXPaletteGetNumComponents), [`JPXPaletteGetTable`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXPaletteGetTable)

#### PDEImageJPXGetAttrs

```cpp
void PDEImageJPXGetAttrs(IN PDEImageJPX pdeImageJPX, OUT PDEImageJPXAttrsP attrsP, IN ASUns32 attrsSize)
```

Header: `PERProcs.h:2758`

Gets the attributes of a JPX encoded PDEImage. @since

**Parameters**

- `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT A JPX encoded image object.
- `attrsP` (`OUT PDEImageJPXAttrsP`): IN/OUT (Filled by the method) A pointer to a PDEImageJPXAttrs
  structure containing the attributes of the JPX encoded image.
- `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetAttrs)

#### PDEImageJPXGetCosObj

```cpp
void PDEImageJPXGetCosObj(IN PDEImageJPX pdeImageJPX, OUT CosObj *cosObjP)
```

Header: `PERProcs.h:2688`

Gets a Cos object for an image.

**Parameters**

- `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT The JPX image whose Cos object is obtained.
- `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the image.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetType), [`PDEImageAcquireImageJPX`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageAcquireImageJPX)

#### PDEImageJPXGetDataStm

```cpp
ASStm PDEImageJPXGetDataStm(IN PDEImageJPX pdeImageJPX, IN ASUns32 flags)
```

Header: `PERProcs.h:2789`

Returns a stream containing the image data. Color component values are interlaced. For images with greater then 8 bits per component, the component values occupy the least significant bits of a two byte value. Valid values of flags are `0`. @since

**Parameters**

- `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT A JPX encoded image object.
- `flags` (`IN ASUns32`): Unused.

**Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEImageJPXGetNumColorSpaces

```cpp
ASInt32 PDEImageJPXGetNumColorSpaces(IN PDEImageJPX pdeImageJPX)
```

Header: `PERProcs.h:2800`

Returns the number of JPX color spaces reference by the JPX encoded image. @since

**Parameters**

- `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT A JPX encoded image object.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEImageJPXHasPalette

```cpp
ASBool PDEImageJPXHasPalette(IN PDEImageJPX pdeImageJPX)
```

Header: `PERProcs.h:2829`

Returns `true` if the JPX encoded image has a JPX palette @since

**Parameters**

- `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT A JPX encoded image object.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEImageJPXAcquirePalette`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquirePalette)

### Structures (1)

#### PDEImageJPX

```cpp
typedef struct _t_PDEImageJPX* PDEImageJPX
```

Header: `PEExpT.h:419`

A reference to a PDEImageJPX.

## PDEObject

### Functions (6)

#### PDEAcquire

```cpp
void PDEAcquire(IN PDEObject obj)
```

Header: `PERProcs.h:1225`

Increments the reference count for an object.

**Parameters**

- `obj` (`IN PDEObject`): IN/OUT The element whose count is incremented.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

#### PDEAddTag

```cpp
void PDEAddTag(IN PDEObject object, IN ExtensionID clientID, IN ASUns32 tag, IN void *value)
```

Header: `PEWProcs.h:996`

Adds an identifier-value pair to an object. The clientID-tag combination is a unique identifier for the value. Each client has its own identifier space. It is often convenient to use ASAtoms as tags.

**Parameters**

- `object` (`IN PDEObject`): The element to tag. The object may be a PDEElement,
  PDEContent, PDEFont, PDEColorSpace, and so on.
- `clientID` (`IN ExtensionID`): Identifies the caller/client. For clients,
  this should be the gExtensionID extension. For the Adobe
  PDF Library, if there is only one client of the PDFEdit
  subsystem, `clientID` should be zero. If there are multiple
  clients, each should specify a nonzero, non-negative `clientID`.
  (A negative `clientID` is reserved for the implementation.)`object`. If `tag` is `0`,
  this is the same as calling PDERemoveTag(). In other words, you cannot tell the difference between a tag whose value is zero and a tag that is nonexistent.

  **Note:** Tags are a purely memory-resident feature. In addition, management of tags is the responsibility of the client. A client must manage any memory pointed to by a tag. This method only contains a pointer to the data passed in by the client. The data and the pointer will not be saved to a file. The generic pointer type is not in the PDF specification.
- `tag` (`IN ASUns32`)
- `value` (`IN void *`): A pointer to a value to associate with `object`. Only the pointer is stored. If the pointer points to data, it is the responsibility of the client to manage the data and its memory.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEGetTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEGetTag), [`PDERemoveTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERemoveTag)

#### PDEGetTag

```cpp
void * PDEGetTag(IN PDEObject object, IN ExtensionID clientID, IN ASUns32 tag)
```

Header: `PEWProcs.h:1017`

Gets an object's value for a given clientID-tag identifier that was added by PDEAddTag.

**Parameters**

- `object` (`IN PDEObject`): The element whose value is obtained.
- `clientID` (`IN ExtensionID`): Identifies the caller/client. For clients, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, `clientID` should be zero. If there are multiple clients, each should specify a nonzero, non-negative `clientID`. (A negative `clientID` is reserved for the implementation.)
- `tag` (`IN ASUns32`): The object's tag. If object has no tag, this is `0`.

**Returns:** `void *`

The value associated with the clientID-tag identifier.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEAddTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEAddTag), [`PDERemoveTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERemoveTag)

#### PDEObjectGetType

```cpp
ASInt32 PDEObjectGetType(IN PDEObject obj)
```

Header: `PERProcs.h:1211`

Gets the type of an element.

**Parameters**

- `obj` (`IN PDEObject`): IN/OUT The element whose type is obtained.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The object type, which is one of PDEType.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDERelease

```cpp
void PDERelease(IN PDEObject obj)
```

Header: `PERProcs.h:1246`

Decrements the reference count for the object. If the count becomes zero, the object is destroyed. Do not call PDERelease() on PDEContent that you acquired with PDPageAcquirePDEContent(); call PDPageReleasePDEContent() instead. **Note:** Objects should only be disposed of with PDERelease() if the method by which they were obtained incremented the reference count for the object. In general, methods that *get* an object do not increment the reference count. Methods that increment the reference count typically contain the word `acquire` or `create` in the method name and specifically state that you must release the object.

**Parameters**

- `obj` (`IN PDEObject`): IN/OUT The element released.

**Returns:** `void`

**See also:** [`PDEAcquire`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEAcquire)

#### PDERemoveTag

```cpp
void PDERemoveTag(IN PDEObject object, IN ExtensionID clientID, IN ASUns32 tag)
```

Header: `PEWProcs.h:1039`

Removes an object's value for a given clientID-tag identifier that was added by PDEAddTag. If PDEAddTag is called with a `0` tag, this is the same as calling PDERemoveTag().

**Parameters**

- `object` (`IN PDEObject`): The element whose tag is removed.
- `clientID` (`IN ExtensionID`): Identifies the caller/client. For clients, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, `clientID` should be zero. If there are multiple clients, each should specify a nonzero, non-negative `clientID`. (A negative `clientID` is reserved for the implementation.)
- `tag` (`IN ASUns32`): The tag value.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEAddTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEAddTag), [`PDEGetTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEGetTag)

### Structures (1)

#### PDEObject

```cpp
typedef struct _t_PDEObject* PDEObject
```

Header: `PEExpT.h:108`

The abstract super class of the PDFEdit classes. You can find the type of any object with the PDEObjectGetType() method. You can then cast and apply that class' methods to the object. In addition, you can cast any of the PDFEdit objects to a PDEObject and use it anywhere a PDEObject is called for, such as in the PDEObject methods.

**See also:** [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease), [`PDEObjectDump`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEObjectDump)

## PDEPS

### Functions (7)

#### PDEPSCreate

```cpp
PDEPS PDEPSCreate(IN PDEPSAttrsP attrsP, IN ASUns32 attrsSize, IN ASStm dataStm, IN ASUns8 *data, IN ASUns32 dataSize)
```

Header: `PEWProcs.h:762`

**Parameters**

- `attrsP` (`IN PDEPSAttrsP`)
- `attrsSize` (`IN ASUns32`)
- `dataStm` (`IN ASStm`)
- `data` (`IN ASUns8 *`)
- `dataSize` (`IN ASUns32`)

**Returns:** [`PDEPS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPS)

#### PDEPSCreateFromCosObj

```cpp
PDEPS PDEPSCreateFromCosObj(const CosObj *cosObjP)
```

Header: `PEWProcs.h:775`

Creates a PDEPS object from a CosObj object. Call PDERelease() to dispose of the returned PDEPS object when finished with it.

**Parameters**

- `cosObjP` ([`const CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT An object of type CosObj.

**Returns:** [`PDEPS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPS)

An object of type PDEPS.

**Exceptions**

- `genErrBadParm`

**See also:** [`PDEPSCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPSCreate)

#### PDEPSGetAttrs

```cpp
void PDEPSGetAttrs(IN PDEPS ps, OUT PDEPSAttrsP attrsP, IN ASUns32 attrsSize)
```

Header: `PERProcs.h:1008`

The following PDEPS methods have been deprecated and do nothing.

**Parameters**

- `ps` (`IN PDEPS`)
- `attrsP` (`OUT PDEPSAttrsP`)
- `attrsSize` (`IN ASUns32`)

**Returns:** `void`

#### PDEPSGetData

```cpp
ASUns32 PDEPSGetData(IN PDEPS ps, OUT ASUns8 *buffer, IN ASUns32 bufferSize, IN ASInt32 offset)
```

Header: `PERProcs.h:1010`

**Parameters**

- `ps` (`IN PDEPS`)
- `buffer` (`OUT ASUns8 *`)
- `bufferSize` (`IN ASUns32`)
- `offset` (`IN ASInt32`)

**Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)

#### PDEPSGetDataStm

```cpp
ASStm PDEPSGetDataStm(IN PDEPS ps)
```

Header: `PERProcs.h:1012`

**Parameters**

- `ps` (`IN PDEPS`)

**Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)

#### PDEPSSetData

```cpp
void PDEPSSetData(IN PDEPS ps, IN ASUns8 *buffer, IN ASUns32 bufferSize)
```

Header: `PEWProcs.h:758`

The following PDEPS methods have been deprecated and do nothing.

**Parameters**

- `ps` (`IN PDEPS`)
- `buffer` (`IN ASUns8 *`)
- `bufferSize` (`IN ASUns32`)

**Returns:** `void`

#### PDEPSSetDataStm

```cpp
void PDEPSSetDataStm(IN PDEPS ps, IN ASStm stm)
```

Header: `PEWProcs.h:760`

**Parameters**

- `ps` (`IN PDEPS`)
- `stm` (`IN ASStm`)

**Returns:** `void`

### Structures (1)

#### PDEPS

```cpp
typedef struct _t_PDEPS* PDEPS
```

Header: `PEExpT.h:210`

An element representing inline or XObject pass-through PostScript object. XObject PostScripts are listed in page XObject resources.

**See also:** `PDEElement (superclass)`, [`PDEPSCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPSCreate), [`PDEPSCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPSCreateFromCosObj)

### Enums (1)

#### PDEPSFlags

Header: `PEExpT.h:1928`

Flags for `PDEPSAttrs`.

**Values**

- `kPDEPSExternal = 0x0001`: PS is an XObject.

## PDEPath

### Functions (8)

#### PDEPathAddSegment

```cpp
void PDEPathAddSegment(IN PDEPath path, IN ASUns32 segType, IN ASFixed x1, IN ASFixed y1, IN ASFixed x2, IN ASFixed y2, IN ASFixed x3, IN ASFixed y3)
```

Header: `PEWProcs.h:1367`

Adds a segment to a path. The number of ASFixed values used depends upon `segType`: `segType` ASFixed values kPDEMoveTo `x1` `y1` kPDELineTo `x1` `y1` kPDECurveTo `x1` `y1` `x2` `y2` `y3` kPDECurveToV `x1` `y1` `x2` `y2` kPDECurveToY `x1` `y1` `x2` `y2` kPDERect `x1` `y1` `x2` (width) `y2` (height) kPDEClosePath None

**Parameters**

- `path` (`IN PDEPath`): IN/OUT The path to which a segment is added.
- `segType` (`IN ASUns32`): IN/OUT A PDEPathElementType value indicating the type of path to add.
- `x1` (`IN ASFixed`): IN/OUT The x-coordinate of the first point.
- `y1` (`IN ASFixed`): IN/OUT The y-coordinate of the first point.
- `x2` (`IN ASFixed`): IN/OUT The x-coordinate of the second point.
- `y2` (`IN ASFixed`): IN/OUT The y-coordinate of the second point.
- `x3` (`IN ASFixed`): IN/OUT The x-coordinate of the third point.
- `y3` (`IN ASFixed`): IN/OUT The y-coordinate of the third point.

**Returns:** `void`

**Exceptions**

- `genErrBadParm`

**See also:** [`PDEPathSetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetData)

#### PDEPathCreate

```cpp
PDEPath PDEPathCreate(void)
```

Header: `PEWProcs.h:479`

Creates an empty path element. Call PDERelease() to dispose of the returned path object when finished with it.

**Parameters**

- (unnamed) (`void`)

**Returns:** [`PDEPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPath)

An empty path element.

#### PDEPathGetData

```cpp
ASUns32 PDEPathGetData(IN PDEPath path, OUT ASInt32 *data, IN ASUns32 dataSize)
```

Header: `PERProcs.h:715`

Gets the size of the path data and, optionally, the path data.

**Parameters**

- `path` (`IN PDEPath`): IN/OUT The path whose data is obtained.
- `data` (`OUT ASInt32 *`): IN/OUT (Filled by the method) A pointer to the path data.
  If `data` is non-`NULL`, it contains a variable-sized array
  of path operators and operands. The format is a 32-bit operator
  followed by 0 to 3 ASFixedPoint values, depending on the
  operator. Opcodes are codes for `moveto`, `lineto`,
  `curveto`, `rect`, or `closepath` operators; operands are `ASFixedPoint` values. If `data` is `NULL`, the number of bytes required for `data` is returned by the method. Note that it returns *raw* path data. If you want the points in page coordinates, concatenate the path data points with the PDEElement matrix obtained from PDEElementGetMatrix().
- `dataSize` (`IN ASUns32`): IN/OUT Specifies the size of the buffer provided in data. If it is less than the length of the path data, the method copies `dataSize` bytes. If it is zero, the ASFixed value of path->size is returned.

**Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)

The length of the data of `path`.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEPathSetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetData), [`PDEPathSetDataEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetDataEx), [`PDEPathGetDataEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetDataEx)

#### PDEPathGetDataEx

```cpp
ASUns32 PDEPathGetDataEx(IN PDEPath path, OUT ASReal *data, IN ASUns32 dataSize)
```

Header: `PERProcs.h:3188`

Gets the size of the path data and, optionally, the path data. This API is an extension to the `PDEPathGetData` API.

**Parameters**

- `path` (`IN PDEPath`): IN/OUT The path whose data is obtained.
- `data` (`OUT ASReal *`): IN/OUT (Filled by the method) A pointer to the path data.
  If `data` is non-`NULL`, it contains a variable-sized array
  of path operators and operands. The format is a 32-bit operator
  followed by 0 to 3 ASReal values, depending on the
  operator. Opcodes are codes for `moveto`, `lineto`,
  `curveto`, `rect`, or `closepath` operators; operands are ASReal values. If `data` is `NULL`, the number of bytes required for `data` is returned by the method. Note that it returns *raw* path data. If you want the points in page coordinates, concatenate the path data points with the PDEElement matrix obtained from PDEElementGetMatrix().
- `dataSize` (`IN ASUns32`): IN/OUT Specifies the size of the buffer provided in data. If it is less than the length of the path data, the method copies `dataSize` bytes.

**Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)

The length of the data of `path`.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEPathGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetData), [`PDEPathSetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetData), [`PDEPathSetDataEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetDataEx)

#### PDEPathGetPaintOp

```cpp
ASUns32 PDEPathGetPaintOp(IN PDEPath path)
```

Header: `PERProcs.h:727`

Gets the fill and stroke attributes of a path.

**Parameters**

- `path` (`IN PDEPath`): The path whose fill and stroke attributes are obtained.

**Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)

A set of PDEPathOpFlags flags describing fill and stroke attributes.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEPathSetPaintOp`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetPaintOp)

#### PDEPathSetData

```cpp
void PDEPathSetData(IN PDEPath path, IN ASInt32 *data, IN ASUns32 dataSize)
```

Header: `PEWProcs.h:455`

Sets new path data for a path element.

**Parameters**

- `path` (`IN PDEPath`): IN/OUT The path whose data is set.
- `data` (`IN ASInt32 *`): IN/OUT A pointer to the path data. It is a variable-sized array of path operators and operands. The format is a 32-bit operator followed by zero to three `ASFixedPoint` values, depending on the operator. Operators are codes for `moveto`, `lineto`, `curveto`, `rect`, or `closepath` operators, and must be one of PDEPathElementType. Operands are `ASFixedPoint` values. The data is copied into the PDEPath object.
- `dataSize` (`IN ASUns32`): IN/OUT The size of the new path data in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEPathGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetData), [`PDEPathSetDataEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetDataEx), [`PDEPathGetDataEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetDataEx)

#### PDEPathSetDataEx

```cpp
void PDEPathSetDataEx(IN PDEPath path, IN ASReal *data, IN ASUns32 dataSize)
```

Header: `PEWProcs.h:3719`

Sets new path data for a path element. This API is an extension to the `PDEPathSetData` API.

**Parameters**

- `path` (`IN PDEPath`): IN/OUT The path whose data is set.
- `data` (`IN ASReal *`): IN/OUT A pointer to the path data. It is a variable-sized array of path operators and operands. The format is a 32-bit operator followed by zero to three ASReal values, depending on the operator. Operators are codes for `moveto`, `lineto`, `curveto`, `rect`, or `closepath` operators, and must be one of PDEPathElementType. Operands are ASReal values. The data is copied into the PDEPath object.
- `dataSize` (`IN ASUns32`): IN/OUT The size of the new path data in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEPathGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetData), [`PDEPathSetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetData), [`PDEPathGetDataEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetDataEx)

#### PDEPathSetPaintOp

```cpp
void PDEPathSetPaintOp(IN PDEPath path, IN ASUns32 op)
```

Header: `PEWProcs.h:468`

Sets the fill and stroke attributes of a path.

**Parameters**

- `path` (`IN PDEPath`): IN/OUT The path whose fill and stroke attributes are set.
- `op` (`IN ASUns32`): IN/OUT The operation to set; it must be one of PDEPathOpFlags.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEPathGetPaintOp`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetPaintOp)

### Structures (1)

#### PDEPath

```cpp
typedef struct _t_PDEPath* PDEPath
```

Header: `PEExpT.h:174`

A PDEElement that contains a path. Path objects can be stroked, filled, and/or serve as clipping paths.

**See also:** `PDEElement (superclass)`, [`PDEPathCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

### Enums (2)

#### PDEPathElementType

Header: `PEExpT.h:1786`

An enumerated data type for path segment operators in PDEPath elements.

**Values**

- `kPDEMoveTo = 0`: Designates the m (`moveto`) operator, which moves the current point.
- `kPDELineTo = 1`: Designates the l (`lineto`) operator, which appends a straight line segment from the current point.
- `kPDECurveTo = 2`: Designates the c (`curveto`) operator, which appends a bezier curve to the path.
- `kPDECurveToV = 3`: Designates the v (`curveto`) operator, which appends a bezier curve to the current path when the first control point coincides with initial point on the curve.
- `kPDECurveToY = 4`: Designates the y (`curveto`) operator, which appends a bezier curve to the current path when the second control point coincides with final point on the curve.
- `kPDERect = 5`: Designates the re operator, which adds a rectangle to the current path.
- `kPDEClosePath = 6`: Designates the h (`closepath`) operator, which closes the current sub-path.
- `kPDEPathLastType = 7`: Designates a special path element which is used as a default. It does not represent any actual path operations like moveto, lineto, etc.

**See also:** [`PDEPathAddSegment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathAddSegment), [`PDEPathCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathCreate), [`PDEPathSetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetData)

#### PDEPathOpFlags

Header: `PEExpT.h:1843`

Flags for paint operators in a PDEPath.

**Values**

- `kPDEInvisible = 0x00`: The path is neither stroked nor filled, so it is invisible.
- `kPDEStroke = 0x01`: Stroke the path, as with the S (`stroke`) operator.
- `kPDEFill = 0x02`: Fills the path, using the nonzero winding number rule to determine the region to fill, as with the f (`fill`) operator.
- `kPDEEoFill = 0x04`: Fills the path, using the even/odd rule to determine the region to fill, as with the f* (`eofill`) operator.

**See also:** [`PDEPathGetPaintOp`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetPaintOp), [`PDEPathSetPaintOp`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetPaintOp)

## PDEPattern

### Functions (2)

#### PDEPatternCreate

```cpp
PDEPattern PDEPatternCreate(const CosObj *cosObjP)
```

Header: `PEWProcs.h:1267`

Creates a pattern object that can be used for a Pattern color space. See the description of Patterns in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.7, page 173. This document is provided on the web site of the International Standards Organization (ISO). Call PDERelease() to dispose of the returned pattern object when finished with it.

**Parameters**

- `cosObjP` ([`const CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT A CosObj stream for the pattern.

**Returns:** [`PDEPattern`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPattern)

A pattern.

**See also:** [`PDEPatternGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPatternGetCosObj)

#### PDEPatternGetCosObj

```cpp
void PDEPatternGetCosObj(IN PDEPattern pattern, OUT CosObj *cosObjP)
```

Header: `PERProcs.h:1482`

Gets a Cos object corresponding to a pattern object.

**Parameters**

- `pattern` (`IN PDEPattern`): IN/OUT The pattern whose Cos object is obtained.
- `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the pattern.

**Returns:** `void`

**See also:** [`PDEPatternCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPatternCreate)

### Structures (1)

#### PDEPattern

```cpp
typedef struct _t_PDEPattern* PDEPattern
```

Header: `PEExpT.h:352`

A reference to a Pattern resource used on a page in a PDF file.

**See also:** [`PDEPatternCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPatternCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease), [`PDEPatternGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPatternGetCosObj)

## PDEPlace

### Functions (5)

#### PDEPlaceCreate

```cpp
PDEPlace PDEPlaceCreate(IN ASAtom mcTag, IN CosObj *cosObjP, IN ASBool isInline)
```

Header: `PEWProcs.h:1121`

Creates a place object. Call PDERelease() to dispose of the returned place object when finished with it.

**Parameters**

- `mcTag` (`IN ASAtom`): IN/OUT The tag name for the place. It must not contain any white space characters (for example, spaces or tabs).
- `cosObjP` (`IN CosObj *`): IN/OUT An optional Marked Content dictionary associated with the place.
- `isInline` (`IN ASBool`): If `true`, it emits the place's dictionary into the content stream inline. If `false`, then the dictionary is emitted outside of the content stream and referenced by name. See the Property Lists section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.6.2, page 554. You can find this document on the web store of the International Standards Organization (ISO).

**Returns:** [`PDEPlace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPlace)

The place object.

#### PDEPlaceGetDict

```cpp
ASBool PDEPlaceGetDict(IN PDEPlace pdePlace, OUT CosObj *placeDictP, OUT ASBool *isInline)
```

Header: `PERProcs.h:1389`

Gets the Marked Content dictionary for a PDEPlace.

**Parameters**

- `pdePlace` (`IN PDEPlace`): IN/OUT The place whose Marked Content dictionary is obtained.
- `placeDictP` (`OUT CosObj *`): IN/OUT (Filled by the method) A pointer to the Marked Content dictionary; may be `NULL`.
- `isInline` (`OUT ASBool *`): IN/OUT (Filled by the method) If `true`, the Marked Content dictionary is inline; may be `NULL`.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if dictionary is obtained, `false` if no dictionary is present.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEPlaceSetDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPlaceSetDict)

#### PDEPlaceGetMCTag

```cpp
ASAtom PDEPlaceGetMCTag(IN PDEPlace pdePlace)
```

Header: `PERProcs.h:1372`

Gets the Marked Content tag for a PDEPlace.

**Parameters**

- `pdePlace` (`IN PDEPlace`): IN/OUT The place whose Marked Content tag is obtained.

**Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)

A tag for `pdePlace`.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEPlaceSetMCTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPlaceSetMCTag)

#### PDEPlaceSetDict

```cpp
void PDEPlaceSetDict(IN PDEPlace pdePlace, IN CosObj *placeDictP, IN ASBool isInline)
```

Header: `PEWProcs.h:1156`

Sets the Marked Content dictionary for a PDEPlace. The dictionary can be emitted inline or referenced from the `\\Properties` key in the `\Resources` dictionary of the containing stream. @since

**Parameters**

- `pdePlace` (`IN PDEPlace`): IN/OUT The place whose Marked Content dictionary
  is set.
- `placeDictP` (`IN CosObj *`): IN/OUT The Marked Content dictionary for `pdePlace`.
- `isInline` (`IN ASBool`): If `true`, it emits the place's dictionary
  into the content stream inline. If `false`, then the dictionary
  is emitted outside of the content stream and referenced by name.
  See the Property Lists section of the ISO 32000-1:2008, Document Management-Portable
  Document Format-Part 1: PDF 1.7, section 14.6.2, page 554. You can find this document
  on the web store of the International Standards Organization (ISO).

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEPlaceGetDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPlaceGetDict)

#### PDEPlaceSetMCTag

```cpp
void PDEPlaceSetMCTag(IN PDEPlace pdePlace, IN ASAtom mcTag)
```

Header: `PEWProcs.h:1133`

Sets the Marked Content tag for a PDEPlace.

**Parameters**

- `pdePlace` (`IN PDEPlace`): IN/OUT The place whose Marked Content tag is set.
- `mcTag` (`IN ASAtom`): IN/OUT The tag for `pdePlace`.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEPlaceGetMCTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPlaceGetMCTag)

### Structures (1)

#### PDEPlace

```cpp
typedef struct _t_PDEPlace* PDEPlace
```

Header: `PEExpT.h:232`

A PDEElement that marks a place on a page in a PDF file. In a PDF file, a place is represented by the MP or DP Marked Content operators. Marked content is useful for adding structure information to a PDF file. For instance, a drawing program may want to mark a point with information, such as the start of a path of a certain type. Marked content provides a way to retain this information in the PDF file. A DP operator functions the same as the MP operator and, in addition, allows a property list dictionary to be associated with a place.

**See also:** `PDEElement (superclass)`, [`PDEPlaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPlaceCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

## PDEShading

### Functions (3)

#### PDEShadingCreateFromCosObj

```cpp
PDEShading PDEShadingCreateFromCosObj(IN const CosObj *shadingP, IN ASFixedMatrixP matrixP)
```

Header: `PEWProcs.h:1471`

Superseded by PDEShadingCreateFromCosObjEx() in Acrobat 10.0. Creates a smooth shading object. Call PDERelease() to dispose of the returned PDEShading object when finished with it.

**Parameters**

- `shadingP` (`IN const CosObj *`): IN/OUT The shading dictionary.
- `matrixP` (`IN ASFixedMatrixP`): IN/OUT The location and transformation matrix of the shading object.

**Returns:** [`PDEShading`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEShading)

A smooth shading object.

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `cosErrInvalidObj`
- `cosErrExpectedName`
- `genErrBadParm`

**See also:** [`PDEShadingCreateFromCosObjEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEShadingCreateFromCosObjEx)

#### PDEShadingCreateFromCosObjEx

```cpp
PDEShading PDEShadingCreateFromCosObjEx(IN const CosObj *shadingP, IN ASDoubleMatrixP matrixP)
```

Header: `PEWProcs.h:3296`

Creates a smooth shading object. Supersedes PDEShadingCreateFromCosObj() in Acrobat 10.0. Call PDERelease() to dispose of the returned PDEShading object when finished with it.

**Parameters**

- `shadingP` (`IN const CosObj *`): IN/OUT The shading dictionary.
- `matrixP` (`IN ASDoubleMatrixP`): IN/OUT The location and transformation matrix of the shading object.

**Returns:** [`PDEShading`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEShading)

A smooth shading object.

**Exceptions**

- `peErrUnknownPDEColorSpace`
- `cosErrInvalidObj`
- `cosErrExpectedName`
- `genErrBadParm`

**See also:** [`PDEShadingCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEShadingCreateFromCosObj)

#### PDEShadingGetCosObj

```cpp
void PDEShadingGetCosObj(IN PDEShading shading, OUT CosObj *cosObjP)
```

Header: `PERProcs.h:1798`

Gets the CosObj for a PDEShading.

**Parameters**

- `shading` (`IN PDEShading`): IN/OUT A smooth shading object.
- `cosObjP` (`OUT CosObj *`): IN/OUT The Cos dictionary corresponding to shading.

**Returns:** `void`

### Structures (1)

#### PDEShading

```cpp
typedef struct _t_PDEShading* PDEShading
```

Header: `PEExpT.h:265`

A PDEElement that represents smooth shading.

**See also:** `PDEElement (superclass)`, [`PDEShadingCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEShadingCreateFromCosObj), [`PDEShadingGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEShadingGetCosObj)

## PDESoftMask

### Functions (12)

#### PDESoftMaskAcquireForm

```cpp
PDEForm PDESoftMaskAcquireForm(IN PDESoftMask pdeSoftMask, IN ASFixedMatrixP matrixP)
```

Header: `PERProcs.h:1916`

Superseded by PDESoftMaskAcquireFormEx() in Acrobat 10.0. Acquires the PDEForm that defines the soft mask. Call PDERelease() to dispose of the PDEForm when finished with it.

**Parameters**

- `pdeSoftMask` (`IN PDESoftMask`): IN/OUT An object of type PDESoftMask.
- `matrixP` (`IN ASFixedMatrixP`): IN/OUT A matrix defining the transformation from coordinate space to user space.

**Returns:** [`PDEForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEForm)

The XObject form of the soft mask.

**Exceptions**

- `genErrBadParm`
- `peErrWrongPDEObjectType`

**See also:** [`PDESoftMaskAcquireFormEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMaskAcquireFormEx)

#### PDESoftMaskAcquireFormEx

```cpp
PDEForm PDESoftMaskAcquireFormEx(IN PDESoftMask pdeSoftMask, IN ASDoubleMatrixP matrixP)
```

Header: `PERProcs.h:3109`

Supersedes PDESoftMaskAcquireForm() in Acrobat 10.0. Acquires the PDEForm that defines the soft mask. Call PDERelease() to dispose of the PDEForm when finished with it.

**Parameters**

- `pdeSoftMask` (`IN PDESoftMask`): IN/OUT An object of type PDESoftMask.
- `matrixP` (`IN ASDoubleMatrixP`): IN/OUT A matrix defining the transformation from coordinate space to user space.

**Returns:** [`PDEForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEForm)

The XObject form of the soft mask.

**Exceptions**

- `genErrBadParm`
- `peErrWrongPDEObjectType`

**See also:** [`PDESoftMaskAcquireForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMaskAcquireForm)

#### PDESoftMaskCreate

```cpp
PDESoftMask PDESoftMaskCreate(IN CosDoc cosDoc, IN PDESoftMaskCreateFlags type, IN PDEForm pdeForm)
```

Header: `PEWProcs.h:1717`

Creates a new soft mask object. Call PDERelease() to dispose of the returned PDESoftMask object when finished with it.

**Parameters**

- `cosDoc` (`IN CosDoc`): IN/OUT The container document.
- `type` (`IN PDESoftMaskCreateFlags`): IN/OUT Specifies how the mask is to be computed. It is one of the PDESoftMaskCreateFlags.
- `pdeForm` (`IN PDEForm`): IN/OUT The form XObject that defines the soft mask. It is the source of the mask values and the PDColorSpace in which the composite computation is to be done.

**Returns:** [`PDESoftMask`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMask)

The newly created object.

#### PDESoftMaskCreateFromCosObj

```cpp
PDESoftMask PDESoftMaskCreateFromCosObj(IN const CosObj *cosObjP)
```

Header: `PEWProcs.h:1702`

Creates a new soft mask object from its Cos representation. Call PDERelease() to dispose of the returned PDESoftMask object when finished with it.

**Parameters**

- `cosObjP` (`IN const CosObj *`): IN/OUT The soft mask dictionary.

**Returns:** [`PDESoftMask`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMask)

The newly created object.

#### PDESoftMaskCreateFromName

```cpp
PDESoftMask PDESoftMaskCreateFromName(IN ASAtom name)
```

Header: `PEWProcs.h:2251`

Create a new soft mask from a name. Call PDERelease() to dispose of the returned PDESoftMask object when finished with it.

**Parameters**

- `name` (`IN ASAtom`): IN/OUT The new name for the soft mask. Note that, currently, the only valid name is `None`.

**Returns:** [`PDESoftMask`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMask)

The newly created object.

#### PDESoftMaskGetBackdropColor

```cpp
ASInt32 PDESoftMaskGetBackdropColor(IN PDESoftMask pdeSoftMask, IN ASFixed *pColorValues, IN ASInt32 numValues)
```

Header: `PERProcs.h:1933`

Gets the array of color values of the backdrop color. Given a pointer to an array and the length of the array, it copies the color values to that array and returns the number of values copied. If the pointer to the array is `NULL`, the number of color values is returned.

**Parameters**

- `pdeSoftMask` (`IN PDESoftMask`): IN/OUT An object of type PDESoftMask.
- `pColorValues` (`IN ASFixed *`): IN/OUT (Filled by the method) A pointer to an array of color values. If it is `NULL`, the number of color values is returned.
- `numValues` (`IN ASInt32`): IN/OUT The length of the array `pColorValues`.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The number of values copied.

#### PDESoftMaskGetCosObj

```cpp
void PDESoftMaskGetCosObj(IN PDESoftMask pdeSoftMask, OUT CosObj *cosObjP)
```

Header: `PERProcs.h:1899`

Gets the associated CosObj of the soft mask.

**Parameters**

- `pdeSoftMask` (`IN PDESoftMask`): IN/OUT The soft mask.
- `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) A pointer to the Cos object.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDESoftMaskGetName

```cpp
ASAtom PDESoftMaskGetName(IN PDESoftMask pdeSoftMask)
```

Header: `PERProcs.h:2306`

Gets the soft mask name.

**Parameters**

- `pdeSoftMask` (`IN PDESoftMask`): IN/OUT The soft mask.

**Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)

The soft mask name if it is a name; it returns ASAtomNull otherwise.

#### PDESoftMaskGetTransferFunction

```cpp
CosObj PDESoftMaskGetTransferFunction(IN PDESoftMask pdeSoftMask)
```

Header: `PERProcs.h:1942`

Gets the transfer function as a CosObj.

**Parameters**

- `pdeSoftMask` (`IN PDESoftMask`): IN/OUT The soft mask.

**Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)

The transfer function as a CosObj.

#### PDESoftMaskSetBackdropColor

```cpp
void PDESoftMaskSetBackdropColor(IN PDESoftMask pdeSoftMask, IN ASFixed *pColorValues, IN ASInt32 numValues)
```

Header: `PEWProcs.h:1737`

Sets the backdrop color values.

**Parameters**

- `pdeSoftMask` (`IN PDESoftMask`): IN/OUT The soft mask object.
- `pColorValues` (`IN ASFixed *`): IN/OUT A series of color values.
- `numValues` (`IN ASInt32`): IN/OUT The number of values pointed to by `pColorValues`.

**Returns:** `void`

#### PDESoftMaskSetTransferFunction

```cpp
void PDESoftMaskSetTransferFunction(IN PDESoftMask pdeSoftMask, IN CosObj cosTransferFunction)
```

Header: `PEWProcs.h:1748`

Sets the transfer function associated with the soft mask.

**Parameters**

- `pdeSoftMask` (`IN PDESoftMask`): IN/OUT The soft mask object.
- `cosTransferFunction` (`IN CosObj`): IN/OUT The transfer function dictionary.

**Returns:** `void`

#### PDESoftMaskSetXGroup

```cpp
void PDESoftMaskSetXGroup(IN PDESoftMask pdeSoftMask, IN PDEForm pdeForm)
```

Header: `PEWProcs.h:1726`

Sets the PDEForm that defines the soft mask.

**Parameters**

- `pdeSoftMask` (`IN PDESoftMask`): IN/OUT The soft mask object.
- `pdeForm` (`IN PDEForm`): IN/OUT The form XObject.

**Returns:** `void`

### Structures (1)

#### PDESoftMask

```cpp
typedef struct _t_PDESoftMask* PDESoftMask
```

Header: `PEExpT.h:375`

An object for creating and manipulating a soft mask in a PDF file.

**See also:** `PDEElement (superclass)`, [`PDESoftMaskCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMaskCreate), [`PDESoftMaskCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMaskCreateFromCosObj), [`PDESoftMaskCreateFromName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMaskCreateFromName), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

### Enums (1)

#### PDESoftMaskCreateFlags

Header: `PEExpT.h:2063`

Flags for use with PDESoftMaskCreate().

**Values**

- `kPDESoftMaskTypeLuminosity = 0x0001`: Specifies how the mask is to be computed.
- `kPDESoftMaskTypeAlpha = 0x0002`: Specifies how the mask is to be computed.

**See also:** [`PDESoftMaskCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMaskCreate)

## PDEText

### Functions (46)

#### PDETextAdd

```cpp
void PDETextAdd(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN ASUns8 *text, IN ASInt32 textLen, IN PDEFont font, IN PDEGraphicStateP gstateP, IN ASUns32 gstateLen, IN PDETextStateP tstateP, IN ASUns32 tstateLen, IN ASFixedMatrixP textMatrixP, IN ASFixedMatrixP strokeMatrixP)
```

Header: `PEWProcs.h:380`

Superseded by PDETextAddEx() in Acrobat 10.0. Adds a character or a text run to a PDEThe text object. **Note:** This method does not change the reference count of `pdeText`; however, the reference count of the objects in the `gstateP` parameter are incremented. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run.

**Parameters**

- `pdeText` (`IN PDEText`): The text object to which a character or text run is added.
- `flags` (`IN ASUns32`): A PDETextFlags that specifies what kind of text to add. It must be one of the following values:
- `index` (`IN ASInt32`): The index after which to add the character or text run.
- `text` (`IN ASUns8 *`): A pointer to the characters to add. Note that passing `NULL` for the text can invalidate the text object, but will not raise an error. Callers must not pass `NULL` for this parameter.
- `textLen` (`IN ASInt32`): The length of the text in bytes.
- `font` (`IN PDEFont`): The font for the element.
- `gstateP` (`IN PDEGraphicStateP`): A pointer to a PDEGraphicStateP structure with the graphics state for the element.
- `gstateLen` (`IN ASUns32`): The length of the graphics state for the element.
- `tstateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with the text state for the element. Note that PDFEdit ignores the `wasSetFlags` flag of the `PDETextState` structure, so you must initialize the `PDETextState` fields.
- `tstateLen` (`IN ASUns32`): The length of the text state for the element.
- `textMatrixP` (`IN ASFixedMatrixP`): A pointer to an `ASFixedMatrix` that holds the matrix for the element.
- `strokeMatrixP` (`IN ASFixedMatrixP`): A pointer to an `ASFixedMatrix` that holds the matrix for the line width when stroking text. It may be `NULL`. Note that this field is not currently used.

**Returns:** `void`

**Exceptions**

- `pdErrBadResMetrics`
- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtPoint), [`PDETextReplaceChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextReplaceChars), [`PDETextSplitRunAt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextSplitRunAt), [`PDETextAddEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddEx)

#### PDETextAddEx

```cpp
void PDETextAddEx(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN ASUns8 *text, IN ASInt32 textLen, IN PDEFont font, IN PDEGraphicStateP gstateP, IN ASUns32 gstateLen, IN PDETextStateP tstateP, IN ASUns32 tstateLen, IN ASDoubleMatrixP textMatrixP, IN ASDoubleMatrixP strokeMatrixP)
```

Header: `PEWProcs.h:3636`

Adds a character or a text run to a PDEThe text object. Supersedes PDETextAdd() in Acrobat 10.0. **Note:** This method does not change the reference count of `pdeText`; however, the reference count of the objects in the `gstateP` parameter are incremented. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run.

**Parameters**

- `pdeText` (`IN PDEText`): The text object to which a character or text run is added.
- `flags` (`IN ASUns32`): A PDETextFlags that specifies what kind of text to add. It must be one of the following values:
- `index` (`IN ASInt32`): The index after which to add the character or text run.
- `text` (`IN ASUns8 *`): A pointer to the characters to add. Note that passing `NULL` for the text can invalidate the text object, but will not raise an error. Callers must not pass `NULL` for this parameter.
- `textLen` (`IN ASInt32`): The length of the text in bytes.
- `font` (`IN PDEFont`): The font for the element.
- `gstateP` (`IN PDEGraphicStateP`): A pointer to a PDEGraphicStateP structure with the graphics state for the element.
- `gstateLen` (`IN ASUns32`): The length of the graphics state for the element.
- `tstateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with the text state for the element. Note that PDFEdit ignores the `wasSetFlags` flag of the `PDETextState` structure, so you must initialize the `PDETextState` fields.
- `tstateLen` (`IN ASUns32`): The length of the text state for the element.
- `textMatrixP` (`IN ASDoubleMatrixP`): A pointer to an `ASDoubleMatrix` that holds the matrix for the element.
- `strokeMatrixP` (`IN ASDoubleMatrixP`): A pointer to an `ASDoubleMatrix` that holds the matrix for the line width when stroking text. It may be `NULL`. Note that this field is currently not used.

**Returns:** `void`

**Exceptions**

- `pdErrBadResMetrics`
- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtPoint), [`PDETextReplaceChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextReplaceChars), [`PDETextSplitRunAt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextSplitRunAt), [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd)

#### PDETextAddGlyphs

```cpp
void PDETextAddGlyphs(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN PDEGlyphRunP glyphRun, IN PDEFont font, IN PDEGraphicStateP gstateP, IN ASUns32 gstateLen, IN PDETextStateP tstateP, IN ASUns32 tstateLen, IN ASFixedMatrixP textMatrixP, IN ASFixedMatrixP strokeMatrixP)
```

Header: `PEWProcs.h:2634`

Superseded by PDETextAddGlyphsEx() in Acrobat 10.0. Adds Unicode text to a PDEText object. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method does not change the reference count of `pdeText`; however, the reference count of the objects in the `gstateP` parameter are incremented.

**Parameters**

- `pdeText` (`IN PDEText`): The text object to which a character or text run is added.
- `flags` (`IN ASUns32`): A PDETextFlags that specifies what kind of text to add. It must be one of the following values:
- `index` (`IN ASInt32`): The index after which to add the character or text run.
- `glyphRun` (`IN PDEGlyphRunP`): A pointer to a `PDEGlyphRun` structure with Unicode data, GlyphIDs and their correspondence.
- `font` (`IN PDEFont`): The font for the element.
- `gstateP` (`IN PDEGraphicStateP`): A pointer to a PDEGraphicStateP structure with the graphics state for the element.
- `gstateLen` (`IN ASUns32`): The length of the graphics state for the element.
- `tstateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with text state for the element. Note that PDFEdit ignores the `wasSetFlags` flag of the `PDETextState` structure, so you must initialize the `PDETextState` fields.
- `tstateLen` (`IN ASUns32`): The length of the text state for the element.
- `textMatrixP` (`IN ASFixedMatrixP`): A pointer to an `ASFixedMatrix` that holds the matrix for the element.
- `strokeMatrixP` (`IN ASFixedMatrixP`): A pointer to an `ASFixedMatrix` that holds the matrix for the line width when stroking text. It may be `NULL`. Note that, currently, this field is not used.

**Returns:** `void`

**Exceptions**

- `pdErrBadResMetrics`
- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd), [`PDETextAddGlyphsEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddGlyphsEx)

#### PDETextAddGlyphsEx

```cpp
void PDETextAddGlyphsEx(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN PDEGlyphRunP glyphRun, IN PDEFont font, IN PDEGraphicStateP gstateP, IN ASUns32 gstateLen, IN PDETextStateP tstateP, IN ASUns32 tstateLen, IN ASDoubleMatrixP textMatrixP, IN ASDoubleMatrixP strokeMatrixP)
```

Header: `PEWProcs.h:3581`

Adds Unicode text to a PDEText object. Supersedes PDETextAddGlyphs() in Acrobat 10.0. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method does not change the reference count of `pdeText`; however, the reference count of the objects in the `gstateP` parameter are incremented.

**Parameters**

- `pdeText` (`IN PDEText`): The text object to which a character or text run is added.
- `flags` (`IN ASUns32`): A PDETextFlags that specifies what kind of text to add. It must be one of the following values:
- `index` (`IN ASInt32`): The index after which to add the character or text run.
- `glyphRun` (`IN PDEGlyphRunP`): A pointer to a `PDEGlyphRun` structure with Unicode data, GlyphIDs and their correspondence.
- `font` (`IN PDEFont`): The font for the element.
- `gstateP` (`IN PDEGraphicStateP`): A pointer to a PDEGraphicStateP structure with the graphics state for the element.
- `gstateLen` (`IN ASUns32`): The length of the graphics state for the element.
- `tstateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with text state for the element. Note that PDFEdit ignores the `wasSetFlags` flag of the `PDETextState` structure, so you must initialize the `PDETextState` fields.
- `tstateLen` (`IN ASUns32`): The length of the text state for the element.
- `textMatrixP` (`IN ASDoubleMatrixP`): A pointer to an `ASDoubleMatrix` that holds the matrix for the element.
- `strokeMatrixP` (`IN ASDoubleMatrixP`): A pointer to an `ASDoubleMatrix` that holds the matrix for the line width when stroking text. It may be `NULL`. Note that this field is currently not used.

**Returns:** `void`

**Exceptions**

- `pdErrBadResMetrics`
- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextAddEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddEx), [`PDETextAddGlyphs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddGlyphs)

#### PDETextAddItem

```cpp
void PDETextAddItem(IN PDEText text, IN ASInt32 addIndex, IN PDETextItem textItem)
```

Header: `PEWProcs.h:2543`

Adds a text item to a text element at a given index position.

**Parameters**

- `text` (`IN PDEText`): The text object to which the text item is added.
- `addIndex` (`IN ASInt32`): The index of the text item in `pdeText`.
- `textItem` (`IN PDETextItem`): The text item to add.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextGetItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetItem), [`PDETextRemoveItems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRemoveItems), [`PDETextItemCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemCreate)

#### PDETextCreate

```cpp
PDEText PDETextCreate(void)
```

Header: `PEWProcs.h:430`

Creates an empty text object. Call PDERelease() to dispose of the returned text object when finished with it.

**Parameters**

- (unnamed) (`void`)

**Returns:** [`PDEText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEText)

An empty text object.

#### PDETextGetAdvance

```cpp
void PDETextGetAdvance(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASFixedPointP advanceP)
```

Header: `PERProcs.h:2524`

Gets the advance width of a character or a text element. Advance width is returned in either character space or user space. The advance width is the amount by which the current point advances when the character is drawn. Advance width may be horizontal or vertical, depending on the writing style. Thus `advanceP` has both a horizontal and vertical component. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. In addition, set the kPDETextPageSpace flag to obtain the advance width in user space. If it is not set, the advance width is in character space. If this flag is not set, this method returns a value that is independent of any sizes, matrices, or scaling, simply adding up the font's raw glyph widths, supplemented only by unscaled character and word spacing.

**Parameters**

- `pdeText` (`IN PDEText`): A text object containing a character or text run whose advance width is found.
- `flags` (`IN ASUns32`): A PDETextFlags value that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): The index of the character or text run in `pdeText`.
- `advanceP` (`OUT ASFixedPointP`): (Filled by the method) A pointer to a `ASFixedPoint` value indicating the advance width.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextGetAdvanceWidth`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetAdvanceWidth)

#### PDETextGetAdvanceWidth

```cpp
void PDETextGetAdvanceWidth(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASFixedPointP advanceP)
```

Header: `PERProcs.h:608`

Gets the advance width of a character or a text element. Advance width is returned in either character space or user space. The advance width is the amount by which the current point advances when the character is drawn. Advance width may be horizontal or vertical, depending on the writing style. Thus `advanceP` has both a horizontal and vertical component. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. In addition, set the kPDETextPageSpace flag to obtain the advance width in user space. If it is not set, the advance width is in character space. If this flag is not set, this method returns a value that is independent of any sizes, matrices, or scaling, simply adding up the font's raw glyph widths, supplemented only by unscaled character and word spacing.

**Parameters**

- `pdeText` (`IN PDEText`): A text object containing a character or text run whose advance width is found.
- `flags` (`IN ASUns32`): A PDETextFlags value that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): The index of the character or text run in `pdeText`.
- `advanceP` (`OUT ASFixedPointP`): (Filled by the method) A pointer to a `ASFixedPoint` value indicating the advance width.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

#### PDETextGetBBox

```cpp
void PDETextGetBBox(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASFixedRectP bboxP)
```

Header: `PERProcs.h:399`

Gets the bounding box of a character or a text run. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose bounding box is found.
- `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`.
- `bboxP` (`OUT ASFixedRectP`): IN/OUT (Filled by the method) A pointer to `ASFixedRect` to set to the bounding box of specified character or text run.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

#### PDETextGetFont

```cpp
PDEFont PDETextGetFont(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index)
```

Header: `PERProcs.h:498`

Gets the font for a text character or element. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method does not change the reference count of the returned PDEFont.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose font is found.
- `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`.

**Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)

The font of the specified character or text run.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextRunSetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetFont)

#### PDETextGetGState

```cpp
void PDETextGetGState(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT PDEGraphicStateP stateP, IN ASUns32 stateSize)
```

Header: `PERProcs.h:432`

Gets the graphics state of a character or a text run. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method does not increment the reference count of the objects in `stateP`.

**Parameters**

- `pdeText` (`IN PDEText`): A text object containing a character or text run whose graphics state is found.
- `flags` (`IN ASUns32`): A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): The index of the character or text run in `pdeText`.
- `stateP` (`OUT PDEGraphicStateP`): (Filled by the method) A pointer to a `PDEGraphicState` structure with the graphics state of the specified character or text run.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextRunSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetGState), [`PDETextGetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetGStateEx)

#### PDETextGetGStateEx

```cpp
void PDETextGetGStateEx(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT PDEGraphicStateExP stateP, IN ASUns32 stateSize)
```

Header: `PERProcs.h:3289`

Gets the graphics state of a character or a text run. This method fills `PDEGraphicStateEx` as output which is higher precision alternative of `PDEGraphicState` structure. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method does not increment the reference count of the objects in `stateP`.

**Parameters**

- `pdeText` (`IN PDEText`): A text object containing a character or text run whose graphics state is found.
- `flags` (`IN ASUns32`): A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): The index of the character or text run in `pdeText`.
- `stateP` (`OUT PDEGraphicStateExP`): (Filled by the method) A pointer to a PDEGraphicStateExP structure with the graphics state of the specified character or text run.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextRunSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetGState), [`PDETextRunSetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetGStateEx), [`PDETextGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetGState)

#### PDETextGetItem

```cpp
PDETextItem PDETextGetItem(IN PDEText text, IN ASUns32 index)
```

Header: `PERProcs.h:2640`

Obtains a text item from a text element at a given index position.

**Parameters**

- `text` (`IN PDEText`): Text object from which the text item is obtained.
- `index` (`IN ASUns32`): The index of the text item in `pdeText`.

**Returns:** [`PDETextItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItem)

The text item object.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextAddItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddItem), [`PDETextItemCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemCreate)

#### PDETextGetMatrix

```cpp
void PDETextGetMatrix(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASFixedMatrixP matrixP)
```

Header: `PERProcs.h:2338`

Superseded by PDETextGetMatrixEx() in Acrobat 10.0. Returns the matrix of a character or a text element. Unlike PDETextGetTextMatrix(), this function does not take `fontSize`, `hScale`, and `textRise` in the `textState` into account. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose graphics state is found.
- `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`.
- `matrixP` (`OUT ASFixedMatrixP`): IN/OUT (Filled by the method) An ASFixedMatrixP that holds the matrix of the specified character or text run.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextGetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextMatrix), [`PDETextGetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetMatrixEx)

#### PDETextGetMatrixEx

```cpp
void PDETextGetMatrixEx(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASDoubleMatrixP matrixP)
```

Header: `PERProcs.h:3158`

Supersedes PDETextGetMatrix() in Acrobat 10.0. Returns the matrix of a character or a text element. Unlike PDETextGetTextMatrixEx(), this function does not take `fontSize`, `hScale`, and `textRise` in the `textState` into account. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose graphics state is found.
- `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`.
- `matrixP` (`OUT ASDoubleMatrixP`): IN/OUT (Filled by the method) An ASDoubleMatrixP that holds the matrix of the specified character or text run.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextGetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextMatrixEx), [`PDETextGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetMatrix)

#### PDETextGetNumBytes

```cpp
ASInt32 PDETextGetNumBytes(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index)
```

Header: `PERProcs.h:1619`

Gets the number of bytes occupied by the character code or text run. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT A PDEText object returned from one of the `PDETextCreate` methods whose text is examined.
- `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The number of bytes occupied by the text run or character.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDEFontGetNumCodeBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetNumCodeBytes)

#### PDETextGetNumChars

```cpp
ASInt32 PDETextGetNumChars(IN PDEText pdeText)
```

Header: `PERProcs.h:306`

Gets the number of characters in a text object.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT A text object whose number of characters is found.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The total number of characters in `pdeText`.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextGetNumRuns`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetNumRuns), [`PDETextGetRunForChar`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetRunForChar)

#### PDETextGetNumRuns

```cpp
ASInt32 PDETextGetNumRuns(IN PDEText pdeText)
```

Header: `PERProcs.h:320`

Gets the number of text runs (show strings) in a text object.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT A text object whose number of text runs is found.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The number of text runs in `pdeText`.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDETextGetNumBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetNumBytes), [`PDETextGetRunForChar`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetRunForChar)

#### PDETextGetQuad

```cpp
void PDETextGetQuad(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASFixedQuadP quadP)
```

Header: `PERProcs.h:1359`

Gets the quad bounding the specified text run or character. The advance portion of the quad is based on the left side bearing and advance width. It must be one of the following values: Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. In addition, if the kPDETextBounding flag is set, PDETextGetQuad() uses the font descriptor's `FontBBox`, which is the smallest rectangle that encloses all characters in the font. The advance portion is based on the x-coordinates of the left and right sides of `FontBBox` and the advance width.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose quad is found.
- `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object.
- `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`.
- `quadP` (`OUT ASFixedQuadP`): IN/OUT (Filled by the method) A pointer to `ASFixedQuad` that bounds the specified character or text run.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

#### PDETextGetRunForChar

```cpp
ASInt32 PDETextGetRunForChar(IN PDEText pdeText, IN ASInt32 charIndex)
```

Header: `PERProcs.h:354`

Gets the index of the text run that contains the nth character in a text object.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT A text object to examine.
- `charIndex` (`IN ASInt32`): IN/OUT The number of the character to find in `pdeText`.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The index of the text run with the specified character index into `pdeText`.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

#### PDETextGetState

```cpp
void PDETextGetState(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT PDETextStateP stateP, IN ASUns32 stateSize)
```

Header: `PERProcs.h:2235`

Returns the text state of a character or a text element. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose text state is found.
- `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`.
- `stateP` (`OUT PDETextStateP`): IN/OUT (Filled by the method) A pointer to a `PDETextState` structure to fill with the text state of the specified character or text run.
- `stateSize` (`IN ASUns32`): IN/OUT The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `genErrBadParm`
- `peErrWrongPDEObjectType`

**See also:** [`PDETextRunSetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextState), [`PDETextGetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextState)

#### PDETextGetStrokeMatrix

```cpp
void PDETextGetStrokeMatrix(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASFixedMatrixP matrixP)
```

Header: `PERProcs.h:567`

Superseded by PDETextGetStrokeMatrixEx() in Acrobat 10.0. Gets the stroke matrix of a character or a text run. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method returns no valid information.

**Parameters**

- `pdeText` (`IN PDEText`): A text object containing a character or text run whose stroke matrix is found.
- `flags` (`IN ASUns32`): A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): The index of the character or text run in `pdeText`.
- `matrixP` (`OUT ASFixedMatrixP`): (Filled by the method) A pointer to `ASFixedMatrix` that holds the stroke matrix of the specified character or text run. This matrix is the transformation for line widths when stroking. The `h` and `v` values of the matrix are ignored.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextRunSetStrokeMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetStrokeMatrix), [`PDETextGetStrokeMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetStrokeMatrixEx)

#### PDETextGetStrokeMatrixEx

```cpp
void PDETextGetStrokeMatrixEx(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASDoubleMatrixP matrixP)
```

Header: `PERProcs.h:3091`

Supersedes PDETextGetStrokeMatrix() in Acrobat 10.0. Gets the stroke matrix of a character or a text run. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method returns no valid information.

**Parameters**

- `pdeText` (`IN PDEText`): A text object containing a character or text run whose stroke matrix is found.
- `flags` (`IN ASUns32`): A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): The index of the character or text run in `pdeText`.
- `matrixP` (`OUT ASDoubleMatrixP`): (Filled by the method) A pointer to `ASDoubleMatrix` that holds the stroke matrix of the specified character or text run. This matrix is the transformation for line widths when stroking. The `h` and `v` values of the matrix are ignored.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextRunSetStrokeMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetStrokeMatrixEx), [`PDETextGetStrokeMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetStrokeMatrix)

#### PDETextGetText

```cpp
ASInt32 PDETextGetText(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASUns8 *textBuffer)
```

Header: `PERProcs.h:640`

Gets the text for a text run or character. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose text is found.
- `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`.
- `textBuffer` (`OUT ASUns8 *`): IN/OUT (Filled by the method) The text of the specified character or text run. `textBuffer` must be large enough to hold the returned text. If `textBuffer` is `NULL`, it returns the number of bytes required to hold the data.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The number of bytes in the text run or character.

**Exceptions**

- `genErrBadParm`
- `peErrWrongPDEObjectType`

**See also:** [`PDETextGetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextMatrix), [`PDETextGetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextState)

#### PDETextGetTextMatrix

```cpp
void PDETextGetTextMatrix(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASFixedMatrixP matrixP)
```

Header: `PERProcs.h:533`

Superseded by PDETextGetTextMatrixEx() in Acrobat 10.0. Gets the matrix of a character or a text run. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run.

**Parameters**

- `pdeText` (`IN PDEText`): A text object containing a character or text run whose matrix is found.
- `flags` (`IN ASUns32`): A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): The index of the character or text run in `pdeText`.
- `matrixP` (`OUT ASFixedMatrixP`): (Filled by the method) A pointer to `ASFixedMatrix` that holds the matrix of the specified character or text run. This is the transformation matrix from user space to the current text space. The `h` and `v` values of the matrix indicate the origin of the first character.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextRunSetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextMatrix), [`PDETextGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetMatrix), [`PDETextGetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextMatrixEx)

#### PDETextGetTextMatrixEx

```cpp
void PDETextGetTextMatrixEx(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASDoubleMatrixP matrixP)
```

Header: `PERProcs.h:3057`

Supersedes PDETextGetTextMatrix() in Acrobat 10.0. Gets the matrix of a character or a text run. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run.

**Parameters**

- `pdeText` (`IN PDEText`): A text object containing a character or text run whose matrix is found.
- `flags` (`IN ASUns32`): A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): The index of the character or text run in `pdeText`.
- `matrixP` (`OUT ASDoubleMatrixP`): (Filled by the method) A pointer to `ASDoubleMatrix` that holds the matrix of the specified character or text run. This is the transformation matrix from user space to the current text space. The `h` and `v` values of the matrix indicate the origin of the first character.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextRunSetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextMatrixEx), [`PDETextGetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetMatrixEx), [`PDETextGetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextMatrix)

#### PDETextGetTextState

```cpp
void PDETextGetTextState(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT PDETextStateP stateP, IN ASUns32 stateSize)
```

Header: `PERProcs.h:467`

Gets the text state of a character or a text element. **Note:** This function handles only `charSpacing`, `wordSpacing`, and `renderMode` for backward compatibility. For all attributes, use PDETextGetState() instead. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose text state is found.
- `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`.
- `stateP` (`OUT PDETextStateP`): IN/OUT (Filled by the method) A pointer to a `PDETextState` structure to fill with the text state of the specified character or text run.
- `stateSize` (`IN ASUns32`): IN/OUT The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextGetState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetState), [`PDETextRunSetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextState)

#### PDETextIsAtPoint

```cpp
ASBool PDETextIsAtPoint(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN ASFixedPoint point)
```

Header: `PERProcs.h:1731`

Tests whether a point is on specified text. It checks if the point is in a bounding box for the PDEText. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT The text to test.
- `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`.
- `point` (`IN ASFixedPoint`): IN/OUT The point, specified in user space coordinates.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if the point is on the text, `false` otherwise.

**See also:** [`PDEElementIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsAtPoint), [`PDEElementIsAtRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsAtRect)

#### PDETextIsAtRect

```cpp
ASBool PDETextIsAtRect(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN ASFixedRect rect)
```

Header: `PERProcs.h:1760`

Tests whether any part of a rectangle is on the specified text. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT The text to test.
- `flags` (`IN ASUns32`): IN/OUT A PDETextFlags flag that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`.
- `rect` (`IN ASFixedRect`): IN/OUT The rectangle, specified in user space coordinates.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if the text is on the rectangle, `false` otherwise.

**See also:** [`PDEElementIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsAtPoint), [`PDEElementIsAtRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsAtRect), [`PDETextIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtPoint)

#### PDETextRemove

```cpp
void PDETextRemove(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN ASInt32 count)
```

Header: `PEWProcs.h:417`

Removes characters or text runs from a text object. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method decrements the reference count of objects associated with the `pdeText` in the graphic state and font.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT The text object from which text is removed.
- `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`.
- `count` (`IN ASInt32`): IN/OUT The number of characters or text runs to remove.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd), [`PDETextReplaceChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextReplaceChars), [`PDETextSplitRunAt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextSplitRunAt)

#### PDETextRemoveItems

```cpp
void PDETextRemoveItems(IN PDEText text, IN ASUns32 index, IN ASUns32 count)
```

Header: `PEWProcs.h:2560`

Removes contiguous text items from a text element starting at a given index position.

**Parameters**

- `text` (`IN PDEText`): The text object from which the text items are removed.
- `index` (`IN ASUns32`): The index of the first text item in `pdeText` to remove.
- `count` (`IN ASUns32`): The number of text items to remove.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextAddItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddItem), [`PDETextGetItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetItem)

#### PDETextReplaceChars

```cpp
void PDETextReplaceChars(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN ASUns8 *textBuffer, IN ASInt32 numChars)
```

Header: `PEWProcs.h:1300`

Replaces characters in a text object. This method does not change the number of characters in the text object; extra characters are ignored. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT The text object in which characters are replaced.
- `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
- `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`.
- `textBuffer` (`IN ASUns8 *`): IN/OUT Replacement text.
- `numChars` (`IN ASInt32`): IN/OUT The number of bytes to replace.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd), [`PDETextIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtPoint), [`PDETextSplitRunAt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextSplitRunAt)

#### PDETextRunGetCharOffset

```cpp
ASInt32 PDETextRunGetCharOffset(IN PDEText pdeText, IN ASInt32 runIndex)
```

Header: `PERProcs.h:339`

Gets the character offset of the first character of the specified text run.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose graphics state is found.
- `runIndex` (`IN ASInt32`): IN/OUT The index of the text run whose first character's index is returned.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The character offset of the first character of the specified text run in `pdeText`.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextGetNumBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetNumBytes), [`PDETextGetNumRuns`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetNumRuns), [`PDETextGetRunForChar`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetRunForChar)

#### PDETextRunGetNumChars

```cpp
ASInt32 PDETextRunGetNumChars(IN PDEText pdeText, IN ASInt32 runIndex)
```

Header: `PERProcs.h:371`

Gets the number of characters in a text run.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT A text object containing a text run whose number of characters is found.
- `runIndex` (`IN ASInt32`): IN/OUT The index of the text run whose number of characters is returned.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

The number of characters in the specified text run.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextGetNumRuns`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetNumRuns), [`PDETextGetRunForChar`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetRunForChar), [`PDETextRunGetCharOffset`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunGetCharOffset)

#### PDETextRunSetFont

```cpp
void PDETextRunSetFont(IN PDEText pdeText, IN ASInt32 runIndex, IN PDEFont font)
```

Header: `PEWProcs.h:290`

Sets the font of a text run. **Note:** This method decrements the reference count of the previous font and increments the reference count of the new font.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT The text object containing a text run whose font is set.
- `runIndex` (`IN ASInt32`): IN/OUT The index of the text run.
- `font` (`IN PDEFont`): IN/OUT The font set for the text run.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextGetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetFont)

#### PDETextRunSetGState

```cpp
void PDETextRunSetGState(IN PDEText pdeText, IN ASInt32 runIndex, IN PDEGraphicStateP stateP, IN ASUns32 stateSize)
```

Header: `PEWProcs.h:248`

Sets the graphics state of a text run. **Note:** This method increments the reference count of objects in `stateP`.

**Parameters**

- `pdeText` (`IN PDEText`): The text object containing a text run whose graphics state is set.
- `runIndex` (`IN ASInt32`): The index of the text run.
- `stateP` (`IN PDEGraphicStateP`): A pointer to a `PDEGraphicState` structure with the graphics state to set.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetGState), [`PDETextRunSetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetGStateEx)

#### PDETextRunSetGStateEx

```cpp
void PDETextRunSetGStateEx(IN PDEText pdeText, IN ASInt32 runIndex, IN PDEGraphicStateExP stateP, IN ASUns32 stateSize)
```

Header: `PEWProcs.h:3786`

Sets the graphics state of a text run. This method takes pointer to PDEGraphicStateEx as input which is higher precision alternative of `PDEGraphicState` structure. @note This method increments the reference count of objects in `stateP`. @since

**Parameters**

- `pdeText` (`IN PDEText`): The text object containing a text run whose
  graphics state is set.
- `runIndex` (`IN ASInt32`): The index of the text run.
- `stateP` (`IN PDEGraphicStateExP`): A pointer to a PDEGraphicStateEx structure
  with the graphics state to set.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetGState), [`PDETextGetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetGStateEx), [`PDETextRunSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetGState)

#### PDETextRunSetMatrix

```cpp
void PDETextRunSetMatrix(IN PDEText pdeText, IN ASInt32 runIndex, IN ASFixedMatrixP matrixP)
```

Header: `PEWProcs.h:2269`

Superseded by PDETextRunSetMatrixEx() in Acrobat 10.0. Sets the matrix of a text run. Unlike PDETextRunSetTextMatrix(), this function does not change `fontSize`, `hScale`, and `textRise` in the `textState` of PDEText.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT The text object containing a text run.
- `runIndex` (`IN ASInt32`): IN/OUT The index of the text run.
- `matrixP` (`IN ASFixedMatrixP`): IN/OUT ASFixedMatrixP pointer.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextRunSetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextMatrix), [`PDETextRunSetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetMatrixEx)

#### PDETextRunSetMatrixEx

```cpp
void PDETextRunSetMatrixEx(IN PDEText pdeText, IN ASInt32 runIndex, IN ASDoubleMatrixP matrixP)
```

Header: `PEWProcs.h:3697`

Sets the matrix of a text run. Supersedes PDETextRunSetMatrix() in Acrobat 10.0. Unlike PDETextRunSetTextMatrixEx(), this function does not change `fontSize`, `hScale`, and `textRise` in the `textState` of PDEText.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT The text object containing a text run.
- `runIndex` (`IN ASInt32`): IN/OUT The index of the text run.
- `matrixP` (`IN ASDoubleMatrixP`): IN/OUT ASDoubleMatrixP pointer.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextRunSetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextMatrixEx), [`PDETextRunSetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetMatrix)

#### PDETextRunSetState

```cpp
void PDETextRunSetState(IN PDEText pdeText, IN ASInt32 runIndex, IN PDETextStateP stateP, IN ASUns32 stateSize)
```

Header: `PEWProcs.h:2067`

Sets the text state of a text run.

**Parameters**

- `pdeText` (`IN PDEText`): The text object containing a text run whose state is set.
- `runIndex` (`IN ASInt32`): The index of the text run.
- `stateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with the state to set.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextRunSetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextState)

#### PDETextRunSetStrokeMatrix

```cpp
void PDETextRunSetStrokeMatrix(IN PDEText pdeText, IN ASInt32 runIndex, IN ASFixedMatrixP matrixP)
```

Header: `PEWProcs.h:328`

Superseded by PDETextRunSetStrokeMatrixEx() in Acrobat 10.0. Sets the stroke matrix of a text run. **Note:** Currently this method is not implemented.

**Parameters**

- `pdeText` (`IN PDEText`): The text object containing a text run whose stroke matrix is set.
- `runIndex` (`IN ASInt32`): The index of the text run.
- `matrixP` (`IN ASFixedMatrixP`): A pointer to an `ASFixedMatrix` that holds the stroke matrix.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextGetStrokeMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetStrokeMatrix), [`PDETextRunSetStrokeMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetStrokeMatrixEx)

#### PDETextRunSetStrokeMatrixEx

```cpp
void PDETextRunSetStrokeMatrixEx(IN PDEText pdeText, IN ASInt32 runIndex, IN ASDoubleMatrixP matrixP)
```

Header: `PEWProcs.h:3452`

Sets the stroke matrix of a text run. Supersedes PDETextRunSetStrokeMatrix() in Acrobat 10.0. **Note:** Currently this method is not implemented (Acrobat 10 and later).

**Parameters**

- `pdeText` (`IN PDEText`): The text object containing a text run whose stroke matrix is set.
- `runIndex` (`IN ASInt32`): The index of the text run.
- `matrixP` (`IN ASDoubleMatrixP`): A pointer to an `ASDoubleMatrix` that holds the stroke matrix.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextGetStrokeMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetStrokeMatrixEx), [`PDETextRunSetStrokeMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetStrokeMatrix)

#### PDETextRunSetTextMatrix

```cpp
void PDETextRunSetTextMatrix(IN PDEText pdeText, IN ASInt32 runIndex, IN ASFixedMatrixP matrixP)
```

Header: `PEWProcs.h:309`

Superseded by PDETextRunSetTextMatrixEx() in Acrobat 10.0. Sets the text matrix of a text run.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT The text object containing a text run whose text matrix is set.
- `runIndex` (`IN ASInt32`): IN/OUT The index of the text run.
- `matrixP` (`IN ASFixedMatrixP`): IN/OUT A pointer to an `ASFixedMatrix` that holds the text matrix.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextGetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextMatrix), [`PDETextRunSetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetMatrix), [`PDETextRunSetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextMatrixEx)

#### PDETextRunSetTextMatrixEx

```cpp
void PDETextRunSetTextMatrixEx(IN PDEText pdeText, IN ASInt32 runIndex, IN ASDoubleMatrixP matrixP)
```

Header: `PEWProcs.h:3433`

Sets the text matrix of a text run. Supersedes PDETextRunSetTextMatrix() in Acrobat 10.0.

**Parameters**

- `pdeText` (`IN PDEText`): IN/OUT The text object containing a text run whose text matrix is set.
- `runIndex` (`IN ASInt32`): IN/OUT The index of the text run.
- `matrixP` (`IN ASDoubleMatrixP`): IN/OUT A pointer to an `ASDoubleMatrix` that holds the text matrix.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextGetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextMatrixEx), [`PDETextRunSetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetMatrixEx), [`PDETextRunSetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextMatrix)

#### PDETextRunSetTextState

```cpp
void PDETextRunSetTextState(IN PDEText pdeText, IN ASInt32 runIndex, IN PDETextStateP stateP, IN ASUns32 stateSize)
```

Header: `PEWProcs.h:272`

Sets the text state of a text run. **Note:** This method has the following side effect: It modifies the text matrix of the run. In order to maintain backward compatibility, this method only directly operates on the first four fields of `PDETextState`. When it is called, it calculates a new text matrix with three additional fields: `fontSize`, `hScale`, and `textRise` (see `PDETextState`). To avoid this behavior, use PDETextRunSetState() instead (which was added to address this problem).

**Parameters**

- `pdeText` (`IN PDEText`): The text object containing a text run whose text state is set.
- `runIndex` (`IN ASInt32`): The index of the text run.
- `stateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with text state.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextGetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextState), [`PDETextRunSetState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetState)

#### PDETextSplitRunAt

```cpp
void PDETextSplitRunAt(IN PDEText pdeText, IN ASInt32 splitLoc)
```

Header: `PEWProcs.h:1250`

Splits a text run into two text runs.

**Parameters**

- `pdeText` (`IN PDEText`): The text object containing a text run to split.
- `splitLoc` (`IN ASInt32`): The split location, relative to the text object. The first text run is from character index `0` up to `splitLoc`. The second text run is from `splitLoc + 1` to the end of the run.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtPoint), [`PDETextReplaceChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextReplaceChars)

### Structures (1)

#### PDEText

```cpp
typedef struct _t_PDEText* PDEText
```

Header: `PEExpT.h:166`

A PDEElement representing text. It is a container for text as show strings or as individual characters. Each sub-element may have different graphics state properties. However, the same clip applies to all sub-elements of a PDEText. Also, the `charpath` of a PDEText can be used to represent a clip.

**See also:** `PDEElement (superclass)`, [`PDETextCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

### Enums (3)

#### PDETextFlags

Header: `PEExpT.h:1740`

A bit field used in PDEText methods.

**Values**

- `kPDETextRun = 0x0001`: Text run.
- `kPDETextChar = 0x0002`: Character (text run with only one character).
- `kPDETextPageSpace = 0x0004`: Obtain the advance width in page space.
- `kPDETextGetBounds = 0x0008`: Fill in the left and right bounds of the text run's bounding box.
- `kPDETextPreciseQuad = 0x0010`

**See also:** [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd), [`PDETextGetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetFont), [`PDETextGetText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetText)

#### PDETextRenderMode

Header: `PEExpT.h:1764`

Flags indicating text rendering mode set by the Tr operator.

**Values**

- `kPDETextFill = 0`: Fill text.
- `kPDETextStroke = 1`: Stroke text.
- `kPDETextFillAndStroke = 2`: Fill and stroke text.
- `kPDETextInvisible = 3`: Text with no fill and no stroke (invisible).

**See also:** [`PDETextCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextCreate)

#### PDETextStateWasSetFlags

Header: `PEExpT.h:678`

A structure describing the text state that was set.

**Values**

- `kPDECharSpacingWasSet = 0x0001`: Character spacing was set corresponding to the Tc operator.
- `kPDEWordSpacingWasSet = 0x0002`: Word spacing was set corresponding to the Tw operator.
- `kPDERenderModeWasSet = 0x0004`: Text rendering mode was set corresponding to the Tr operator.
- `kPDEFontSizeWasSet = 0x0008`: Font size was set corresponding to the Tf operator.
- `kPDEHScaleWasSet = 0x0010`: Horizontal Scaling was set corresponding to the Tz operator.
- `kPDETextRiseWasSet = 0x0020`: Text rise was set corresponding to the Ts operator.

**See also:** [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd), [`PDETextGetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextState), [`PDETextRunSetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextState)

## PDETextItem

### Functions (19)

#### PDETextItemCopyText

```cpp
ASUns32 PDETextItemCopyText(IN PDETextItem textItem, OUT ASUns8 *buffer, IN ASUns32 bufferSize)
```

Header: `PERProcs.h:2607`

Copies the text from a text item element into a character buffer.

**Parameters**

- `textItem` (`IN PDETextItem`): A pointer to the characters to add. Note that passing `NULL` for text can invalidate the text object but will not raise an error. Callers must not pass `NULL` for this parameter.
- `buffer` (`OUT ASUns8 *`): (Filled by the method) A pointer to a buffer in which to store the copy.
- `bufferSize` (`IN ASUns32`): The length of the text buffer in bytes.

**Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)

The length in bytes of `textItem`.

**Exceptions**

- `pdErrBadResMetrics`
- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextGetItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetItem), [`PDETextAddItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddItem), [`PDETextItemGetTextLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetTextLen)

#### PDETextItemCreate

```cpp
PDETextItem PDETextItemCreate(IN ASUns8 *text, IN ASUns32 textLen, IN PDEFont font, IN PDEGraphicStateP gStateP, IN ASUns32 gStateLen, IN PDETextStateP textStateP, IN ASUns32 textStateLen, IN ASFixedMatrix *textMatrixP)
```

Header: `PEWProcs.h:2412`

Superseded by PDETextItemCreateEx() in Acrobat 10.0. Creates a text item element containing a character or text run, which can be added to a PDEText text object. Call PDERelease() to dispose of the returned PDETextItem object when finished with it.

**Parameters**

- `text` (`IN ASUns8 *`): A pointer to the characters to add. Note that passing `NULL` for text can invalidate the text object but will not raise an error. Callers must not pass `NULL` for this parameter.
- `textLen` (`IN ASUns32`): The length of the text in bytes.
- `font` (`IN PDEFont`): The font for the element.
- `gStateP` (`IN PDEGraphicStateP`): A pointer to a PDEGraphicStateP structure with the graphics state for the element.
- `gStateLen` (`IN ASUns32`): The length of the graphics state for the element.
- `textStateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with the text state for the element. Note that PDFEdit ignores the `wasSetFlags` flag of the `PDETextState` structure, so you must initialize the `PDETextState` fields.
- `textStateLen` (`IN ASUns32`): The length of the text state for the element.
- `textMatrixP` (`IN ASFixedMatrix *`): A pointer to an `ASFixedMatrix` that holds the matrix for the element.

**Returns:** [`PDETextItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItem)

**Exceptions**

- `pdErrBadResMetrics`
- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd), [`PDETextAddItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddItem), [`PDETextItemCreateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemCreateEx)

#### PDETextItemCreateEx

```cpp
PDETextItem PDETextItemCreateEx(IN ASUns8 *text, IN ASUns32 textLen, IN PDEFont font, IN PDEGraphicStateP gStateP, IN ASUns32 gStateLen, IN PDETextStateP textStateP, IN ASUns32 textStateLen, IN ASDoubleMatrix *textMatrixP)
```

Header: `PEWProcs.h:3515`

Creates a text item element containing a character or text run, which can be added to a PDEText text object. Supersedes PDETextItemCreate() in Acrobat 10.0. Call PDERelease() to dispose of the returned PDETextItem object when finished with it.

**Parameters**

- `text` (`IN ASUns8 *`): A pointer to the characters to add. Note that passing `NULL` for text can invalidate the text object but will not raise an error. Callers must not pass `NULL` for this parameter.
- `textLen` (`IN ASUns32`): The length of the text in bytes.
- `font` (`IN PDEFont`): The font for the element.
- `gStateP` (`IN PDEGraphicStateP`): A pointer to a PDEGraphicStateP structure with the graphics state for the element.
- `gStateLen` (`IN ASUns32`): The length of the graphics state for the element.
- `textStateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with the text state for the element. Note that PDFEdit ignores the `wasSetFlags` flag of the `PDETextState` structure, so you must initialize the `PDETextState` fields.
- `textStateLen` (`IN ASUns32`): The length of the text state for the element.
- `textMatrixP` (`IN ASDoubleMatrix *`): A pointer to an `ASDoubleMatrix` that holds the matrix for the element.

**Returns:** [`PDETextItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItem)

**Exceptions**

- `pdErrBadResMetrics`
- `peErrWrongPDEObjectType`
- `genErrBadParm`

**See also:** [`PDETextAddEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddEx), [`PDETextAddItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddItem), [`PDETextItemCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemCreate)

#### PDETextItemGetFont

```cpp
PDEFont PDETextItemGetFont(IN PDETextItem textItem)
```

Header: `PERProcs.h:2540`

Gets the font for a text item. **Note:** This method does not change the reference count of the returned PDEFont.

**Parameters**

- `textItem` (`IN PDETextItem`): The text item whose font is obtained.

**Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)

The font of the specified text item.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemSetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetFont)

#### PDETextItemGetGState

```cpp
void PDETextItemGetGState(IN PDETextItem textItem, OUT PDEGraphicStateP stateP, IN ASUns32 stateSize)
```

Header: `PERProcs.h:2624`

Gets the graphics state for a text item.

**Parameters**

- `textItem` (`IN PDETextItem`): Text item whose graphic state is obtained.
- `stateP` (`OUT PDEGraphicStateP`): (Filled by the method) A pointer to a `PDEGraphicState` structure with graphics state of the text item.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetGState), [`PDETextItemGetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetGStateEx)

#### PDETextItemGetGStateEx

```cpp
void PDETextItemGetGStateEx(IN PDETextItem textItem, OUT PDEGraphicStateExP stateP, IN ASUns32 stateSize)
```

Header: `PERProcs.h:3310`

Gets the graphics state for a text item. This method fills `PDEGraphicStateEx` as output which is higher precision alternative of `PDEGraphicState` structure.

**Parameters**

- `textItem` (`IN PDETextItem`): Text item whose graphic state is obtained.
- `stateP` (`OUT PDEGraphicStateExP`): (Filled by the method) A pointer to a `PDEGraphicStateEx` structure with graphics state of the text item.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetGState), [`PDETextItemGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetGState)

#### PDETextItemGetTextLen

```cpp
ASUns32 PDETextItemGetTextLen(IN PDETextItem textItem)
```

Header: `PERProcs.h:2586`

Gets the text length for a text item.

**Parameters**

- `textItem` (`IN PDETextItem`): The text item whose text length is obtained.

**Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)

The text length in bytes.

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemCopyText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemCopyText)

#### PDETextItemGetTextMatrix

```cpp
void PDETextItemGetTextMatrix(IN PDETextItem textItem, IN ASUns32 charOffset, OUT ASFixedMatrix *textMatrixP)
```

Header: `PERProcs.h:2558`

Superseded by PDETextItemGetTextMatrixEx() in Acrobat 10.0. Gets the text matrix for a character in a text item.

**Parameters**

- `textItem` (`IN PDETextItem`): The text item.
- `charOffset` (`IN ASUns32`): The offset of the character whose text matrix is obtained.
- `textMatrixP` (`OUT ASFixedMatrix *`): (Filled by the method) A pointer to a `ASFixedMatrix` structure with the text matrix of the character.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemSetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetTextMatrix), [`PDETextItemGetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetTextMatrixEx)

#### PDETextItemGetTextMatrixEx

```cpp
void PDETextItemGetTextMatrixEx(IN PDETextItem textItem, IN ASUns32 charOffset, OUT ASDoubleMatrix *textMatrixP)
```

Header: `PERProcs.h:3127`

Supersedes PDETextItemGetTextMatrix() in Acrobat 10.0. Gets the text matrix for a character in a text item.

**Parameters**

- `textItem` (`IN PDETextItem`): The text item.
- `charOffset` (`IN ASUns32`): The offset of the character whose text matrix is obtained.
- `textMatrixP` (`OUT ASDoubleMatrix *`): (Filled by the method) A pointer to a `ASDoubleMatrix` structure with the text matrix of the character.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemSetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetTextMatrixEx), [`PDETextItemGetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetTextMatrix)

#### PDETextItemGetTextState

```cpp
void PDETextItemGetTextState(IN PDETextItem textItem, OUT PDETextStateP textStateP, IN ASUns32 textStateSize)
```

Header: `PERProcs.h:2574`

Gets the text state of a text item.

**Parameters**

- `textItem` (`IN PDETextItem`): The text item whose text state is obtained.
- `textStateP` (`OUT PDETextStateP`): (Filled by the method) A pointer to a PDETextStateP structure with text state of the text item.
- `textStateSize` (`IN ASUns32`): The size of the `texStateP` structure in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemSetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetTextState)

#### PDETextItemRemoveChars

```cpp
void PDETextItemRemoveChars(IN PDETextItem textItem, IN ASUns32 charOffset, IN ASUns32 count)
```

Header: `PEWProcs.h:2528`

Removes contiguous characters from a text item.

**Parameters**

- `textItem` (`IN PDETextItem`): The text item whose characters are removed.
- `charOffset` (`IN ASUns32`): The offset of the first character to remove.
- `count` (`IN ASUns32`): The number of characters to remove.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemReplaceChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemReplaceChars), [`PDETextItemReplaceText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemReplaceText)

#### PDETextItemReplaceChars

```cpp
void PDETextItemReplaceChars(IN PDETextItem textItem, IN ASUns32 charIndex, IN ASUns8 *newChar, IN ASUns32 newCharLen)
```

Header: `PEWProcs.h:2512`

Replaces characters in a text item. This method does not change the number of characters in the text item; extra characters are ignored.

**Parameters**

- `textItem` (`IN PDETextItem`): The text item whose characters are replaced.
- `charIndex` (`IN ASUns32`): The index position of the characters to replace.
- `newChar` (`IN ASUns8 *`): The replacement text.
- `newCharLen` (`IN ASUns32`): The number of bytes to replace.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemRemoveChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemRemoveChars), [`PDETextItemReplaceText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemReplaceText)

#### PDETextItemReplaceText

```cpp
void PDETextItemReplaceText(IN PDETextItem textItem, IN ASUns8 *newText, IN ASUns32 newTextLen)
```

Header: `PEWProcs.h:2491`

Replaces all of the text in a text item.

**Parameters**

- `textItem` (`IN PDETextItem`): The text item whose text are replaced.
- `newText` (`IN ASUns8 *`): The replacement text.
- `newTextLen` (`IN ASUns32`): The number of bytes to replace.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemRemoveChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemRemoveChars), [`PDETextItemReplaceChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemReplaceChars)

#### PDETextItemSetFont

```cpp
void PDETextItemSetFont(IN PDETextItem textItem, IN PDEFont font)
```

Header: `PEWProcs.h:2429`

Sets the font for a text item. **Note:** This method decrements the reference count of the previous font and increments the reference count of the new font.

**Parameters**

- `textItem` (`IN PDETextItem`): The text item whose font is set.
- `font` (`IN PDEFont`): The new font object.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemGetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetFont)

#### PDETextItemSetGState

```cpp
void PDETextItemSetGState(IN PDETextItem textItem, OUT PDEGraphicStateP stateP, IN ASUns32 stateSize)
```

Header: `PEWProcs.h:2476`

Sets the graphics state for a text item.

**Parameters**

- `textItem` (`IN PDETextItem`): Text item whose graphics state is set.
- `stateP` (`OUT PDEGraphicStateP`): A pointer to a `PDEGraphicState` structure with graphics state of the text item.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetGState), [`PDETextItemSetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetGStateEx)

#### PDETextItemSetGStateEx

```cpp
void PDETextItemSetGStateEx(IN PDETextItem textItem, OUT PDEGraphicStateExP stateP, IN ASUns32 stateSize)
```

Header: `PEWProcs.h:3806`

Sets the graphics state for a text item. This method takes pointer to PDEGraphicStateEx as input which is higher precision alternative of `PDEGraphicState` structure. @since

**Parameters**

- `textItem` (`IN PDETextItem`): Text item whose graphics state is set.
- `stateP` (`OUT PDEGraphicStateExP`): A pointer to a PDEGraphicStateEx structure
  with graphics state of the text item.
- `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetGState), [`PDETextItemGetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetGStateEx), [`PDETextItemSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetGState)

#### PDETextItemSetTextMatrix

```cpp
void PDETextItemSetTextMatrix(IN PDETextItem textItem, IN ASFixedMatrix *textMatrixP)
```

Header: `PEWProcs.h:2446`

Superseded by PDETextItemSetTextMatrixEx() in Acrobat 10.0. Sets the text matrix for a text item.

**Parameters**

- `textItem` (`IN PDETextItem`): The text item whose text matrix is set.
- `textMatrixP` (`IN ASFixedMatrix *`): A pointer to a `ASFixedMatrix` structure with the new text matrix of the text item.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemGetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetTextMatrix), [`PDETextItemSetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetTextMatrixEx)

#### PDETextItemSetTextMatrixEx

```cpp
void PDETextItemSetTextMatrixEx(IN PDETextItem textItem, IN ASDoubleMatrix *textMatrixP)
```

Header: `PEWProcs.h:3533`

Sets the text matrix for a text item. Supersedes PDETextItemSetTextMatrix() in Acrobat 10.0.

**Parameters**

- `textItem` (`IN PDETextItem`): The text item whose text matrix is set.
- `textMatrixP` (`IN ASDoubleMatrix *`): A pointer to a `ASDoubleMatrix` structure with the new text matrix of the text item.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemGetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetTextMatrixEx), [`PDETextItemSetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetTextMatrix)

#### PDETextItemSetTextState

```cpp
void PDETextItemSetTextState(IN PDETextItem textItem, IN PDETextStateP textStateP, IN ASUns32 textStateSize)
```

Header: `PEWProcs.h:2461`

Sets the text state for a text item.

**Parameters**

- `textItem` (`IN PDETextItem`): The text item whose text state is set.
- `textStateP` (`IN PDETextStateP`): A PDETextStateP structure with the new text state of the text item.
- `textStateSize` (`IN ASUns32`): The size of the `textStateP` structure in bytes.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`
- `genErrBadParm`
- `pdErrBadResMetrics`

**See also:** [`PDETextItemGetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetTextState)

### Structures (1)

#### PDETextItem

```cpp
typedef struct _t_PDETextItem* PDETextItem
```

Header: `PEExpT.h:411`

A reference to a PDETextItem.

## PDEUnknown

### Functions (1)

#### PDEUnknownGetOpName

```cpp
ASAtom PDEUnknownGetOpName(IN PDEUnknown pdeUnknown)
```

Header: `PERProcs.h:1808`

Gets the operator name of an unknown operator.

**Parameters**

- `pdeUnknown` (`IN PDEUnknown`): IN/OUT Unknown element whose operator name is obtained.

**Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)

An ASAtom for the name of the operator for `pdeUnknown`.

### Structures (1)

#### PDEUnknown

```cpp
typedef struct _t_PDEUnknown* PDEUnknown
```

Header: `PEExpT.h:237`

A PDEElement representing an unknown element.

**See also:** `PDEElement (superclass)`

## PDEXGroup

### Functions (9)

#### PDEXGroupAcquireColorSpace

```cpp
PDEColorSpace PDEXGroupAcquireColorSpace(IN PDEXGroup pdeXGroup)
```

Header: `PERProcs.h:1987`

Acquires the color space of the transparency group. Call PDERelease() to dispose of the PDEColorSpace when finished with it.

**Parameters**

- `pdeXGroup` (`IN PDEXGroup`): The transparency group object.

**Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace)

The color space; otherwise it returns `NULL`.

#### PDEXGroupCreate

```cpp
PDEXGroup PDEXGroupCreate(IN CosDoc cosDoc, IN PDEXGroupCreateFlags type)
```

Header: `PEWProcs.h:1774`

Create a new XGroup of the given type. Call PDERelease() to dispose of the returned PDEXGroup object when finished with it.

**Parameters**

- `cosDoc` (`IN CosDoc`): The document in which the object will be created.
- `type` (`IN PDEXGroupCreateFlags`): It must be kPDEXGroupTypeTransparency.

**Returns:** [`PDEXGroup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXGroup)

The newly created transparency group object.

#### PDEXGroupCreateFromCosObj

```cpp
PDEXGroup PDEXGroupCreateFromCosObj(IN const CosObj *cosObjP)
```

Header: `PEWProcs.h:1763`

Creates a new XGroup object from its Cos representation. Call PDERelease() to dispose of the returned PDEXGroup object when finished with it.

**Parameters**

- `cosObjP` (`IN const CosObj *`): IN/OUT The XGroup object dictionary.

**Returns:** [`PDEXGroup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXGroup)

The PDEXGroup object.

#### PDEXGroupGetCosObj

```cpp
void PDEXGroupGetCosObj(IN PDEXGroup pdeXGroup, OUT CosObj *cosObjP)
```

Header: `PERProcs.h:1957`

Gets the CosObj of the transparency group.

**Parameters**

- `pdeXGroup` (`IN PDEXGroup`): The transparency group object.
- `cosObjP` (`OUT CosObj *`): (Filled by the method) A pointer to the Cos object.

**Returns:** `void`

**Exceptions**

- `genErrBadParm`
- `peErrWrongPDEObjectType`

#### PDEXGroupGetIsolated

```cpp
ASBool PDEXGroupGetIsolated(IN PDEXGroup pdeXGroup)
```

Header: `PERProcs.h:1978`

Gets the isolated boolean value of the transparency group.

**Parameters**

- `pdeXGroup` (`IN PDEXGroup`): The transparency group object.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

`true` if the transparency group is isolated; `false` otherwise.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEXGroupGetKnockout

```cpp
ASBool PDEXGroupGetKnockout(IN PDEXGroup pdeXGroup)
```

Header: `PERProcs.h:1967`

Gets the knockout boolean value of the transparency group.

**Parameters**

- `pdeXGroup` (`IN PDEXGroup`): The transparency group object.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

The knockout value.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDEXGroupSetColorSpace

```cpp
void PDEXGroupSetColorSpace(IN PDEXGroup pdeXGroup, IN PDEColorSpace pdeColorSpace)
```

Header: `PEWProcs.h:1804`

Sets the PDEXObject that defines the color space into which colors are converted when painted into this group.

**Parameters**

- `pdeXGroup` (`IN PDEXGroup`): The transparency group object.
- `pdeColorSpace` (`IN PDEColorSpace`): The color space to associate with the XGroup.

**Returns:** `void`

#### PDEXGroupSetIsolated

```cpp
void PDEXGroupSetIsolated(IN PDEXGroup pdeXGroup, IN ASBool isolated)
```

Header: `PEWProcs.h:1794`

Sets the XGroup to be isolated or not. It corresponds to the / I key within the XGroup's dictionary.

**Parameters**

- `pdeXGroup` (`IN PDEXGroup`): IN/OUT The transparency group object.
- `isolated` (`IN ASBool`): IN/OUT `true` to isolate the XGroup, `false` otherwise.

**Returns:** `void`

#### PDEXGroupSetKnockout

```cpp
void PDEXGroupSetKnockout(IN PDEXGroup pdeXGroup, IN ASBool knockout)
```

Header: `PEWProcs.h:1783`

Sets the knockout value.

**Parameters**

- `pdeXGroup` (`IN PDEXGroup`): IN/OUT The transparency group object.
- `knockout` (`IN ASBool`): IN/OUT The knockout value.

**Returns:** `void`

### Structures (1)

#### PDEXGroup

```cpp
typedef struct _t_PDEXGroup* PDEXGroup
```

Header: `PEExpT.h:383`

A transparency (XGroup) resource.

**See also:** `PDEElement (superclass)`, [`PDEXGroupCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXGroupCreate), [`PDEXGroupCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXGroupCreateFromCosObj), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

### Enums (1)

#### PDEXGroupCreateFlags

Header: `PEExpT.h:2075`

An enumerated data type used to specify the type of transparency group to create.

**Values**

- `kPDEXGroupTypeTransparency = 0x0001`: Creates a transparency XGroup object.

**See also:** [`PDESoftMaskCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMaskCreate)

## PDEXObject

### Functions (2)

#### PDEXObjectCreate

```cpp
PDEXObject PDEXObjectCreate(IN const CosObj *cosObjP)
```

Header: `PEWProcs.h:707`

Creates a new PDEXObject from a Cos object. Call PDERelease() to dispose of the returned PDEXObject when finished with it.

**Parameters**

- `cosObjP` (`IN const CosObj *`): IN/OUT The Cos object for the PDEXObject.

**Returns:** [`PDEXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXObject)

A PDEXObject corresponding to `cosObjP`.

**See also:** [`PDEXObjectGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXObjectGetCosObj)

#### PDEXObjectGetCosObj

```cpp
void PDEXObjectGetCosObj(IN PDEXObject xObject, OUT CosObj *cosObjP)
```

Header: `PERProcs.h:983`

Gets a Cos object corresponding to a PDEXObject.

**Parameters**

- `xObject` (`IN PDEXObject`): IN/OUT The PDEXobject whose Cos object is obtained.
- `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for `xObject`.

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDEXObjectCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXObjectCreate)

### Structures (1)

#### PDEXObject

```cpp
typedef struct _t_PDEXObject* PDEXObject
```

Header: `PEExpT.h:217`

A PDEElement representing an arbitrary XObject.

**See also:** `PDEElement (superclass)`, [`PDEXObjectCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXObjectCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

## PDSysEncoding

### Functions (8)

#### PDSysEncodingCreateFromBaseName

```cpp
PDSysEncoding PDSysEncodingCreateFromBaseName(IN ASAtom baseEncName, IN const char **diffEnc)
```

Header: `PEWProcs.h:2086`

Create an encoding object from the base name. Call PDERelease() to dispose of the returned PDSysEncoding object when finished with it.

**Parameters**

- `baseEncName` (`IN ASAtom`): IN/OUT The base encoding. See the description of Base Encoding in the Character Encoding section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.6.6, page 262. You can find this document on the web store of the International Standards Organization (ISO).
- `diffEnc` (`IN const char **`): IN/OUT An array of 256 `const char*` describing the differences from the encoding specified by `baseEncName`. It may be `NULL`.

**Returns:** [`PDSysEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncoding)

An object of type PDSysEncoding.

**Exceptions**

- `genErrBadParm`

**See also:** [`PDSysEncodingSetIsUTF16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncodingSetIsUTF16)

#### PDSysEncodingCreateFromCMapName

```cpp
PDSysEncoding PDSysEncodingCreateFromCMapName(IN ASAtom cmapName)
```

Header: `PEWProcs.h:2097`

Create an encoding object from a PDF CMap name. Call PDERelease() to dispose of the returned PDSysEncoding object when finished with it.

**Parameters**

- `cmapName` (`IN ASAtom`): The CMap name.

**Returns:** [`PDSysEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncoding)

An object of type PDSysEncoding.

**Exceptions**

- `genErrBadParm`

**See also:** [`PDSysEncodingSetIsUTF16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncodingSetIsUTF16)

#### PDSysEncodingCreateFromCMapStream

```cpp
PDSysEncoding PDSysEncodingCreateFromCMapStream(IN CosObj cmapStream)
```

Header: `PEWProcs.h:3225`

Creates an encoding object from a given PDF CMap stream. Call `PDERelease()` to dispose of the returned `PDSysEncoding` object when it is no longer needed.

**Parameters**

- `cmapStream` (`IN CosObj`): The CMap stream from which to create the encoding object.

**Returns:** [`PDSysEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncoding)

The encoding object to be created.

**See also:** [`PDSysEncodingSetIsUTF16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncodingSetIsUTF16)

#### PDSysEncodingCreateFromCodePage

```cpp
PDSysEncoding PDSysEncodingCreateFromCodePage(IN ASInt32 codePage, IN ASInt16 wMode)
```

Header: `PEWProcs.h:2350`

Create an encoding object from a code page. Call PDERelease() to dispose of the returned PDSysEncoding object when finished with it.

**Parameters**

- `codePage` (`IN ASInt32`): The code page character-mapping construct. See Code Page Values.
- `wMode` (`IN ASInt16`): `0` for horizontal writing, `1` for vertical writiing.

**Returns:** [`PDSysEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncoding)

An object of type PDSysEncoding.

**Exceptions**

- `genErrBadParm`

**See also:** [`PDSysEncodingSetIsUTF16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncodingSetIsUTF16)

#### PDSysEncodingGetWMode

```cpp
ASInt16 PDSysEncodingGetWMode(IN PDSysEncoding sysEnc)
```

Header: `PERProcs.h:2261`

Returns writing mode. `0` for horizontal writing and `1` for vertical writing.

**Parameters**

- `sysEnc` (`IN PDSysEncoding`): IN/OUT An object of type PDSysEncoding.

**Returns:** [`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)

`0` for horizontal writing and `1` for vertical writing.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDSysEncodingIsIdentity

```cpp
ASBool PDSysEncodingIsIdentity(IN PDSysEncoding sysEnc)
```

Header: `PERProcs.h:2272`

Returns `true` for Identity-H or Identity-V encoding, `false` otherwise.

**Parameters**

- `sysEnc` (`IN PDSysEncoding`): IN/OUT An object of type PDSysEncoding.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

See above.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDSysEncodingIsMultiByte

```cpp
ASBool PDSysEncodingIsMultiByte(IN PDSysEncoding sysEnc)
```

Header: `PERProcs.h:2282`

Returns `true` for CMap encoding, `false` otherwise.

**Parameters**

- `sysEnc` (`IN PDSysEncoding`): IN/OUT An object of type PDSysEncoding.

**Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)

See above.

**Exceptions**

- `peErrWrongPDEObjectType`

#### PDSysEncodingSetIsUTF16

```cpp
void PDSysEncodingSetIsUTF16(IN PDSysEncoding sysEnc, IN ASBool isUTF16)
```

Header: `PEWProcs.h:3829`

**Parameters**

- `sysEnc` (`IN PDSysEncoding`): IN/OUT An object of type PDSysEncoding.
- `isUTF16` (`IN ASBool`): A boolean value specifying if the encoding is UTF-16

**Returns:** `void`

**Exceptions**

- `peErrWrongPDEObjectType`

### Structures (1)

#### PDSysEncoding

```cpp
typedef struct _t_PDSysEncoding* PDSysEncoding
```

Header: `PEExpT.h:399`

A PDEElement that provides system encoding for a PDF file.

**See also:** `PDEElement (superclass)`, [`PDSysEncodingCreateFromBaseName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncodingCreateFromBaseName), [`PDSysEncodingCreateFromCMapName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncodingCreateFromCMapName), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease)

## PDSysFont

### Functions (18)

#### PDEmbedSysFontForPDEFont

```cpp
void PDEmbedSysFontForPDEFont(IN PDEFont font, IN ASUns32 flags, IN CosDoc cosDoc)
```

Header: `PDSysFont.h:330`

If there is a font on the system that matches this PDEFont, embed the full font regardless of whether it was subsetted or not embedded at all in the first place. This will not work for CID fonts, because they must be subsetted. The matching is based on the PDSysFontMatchFlags. Only the font object itself is modified; no content streams are changed. **Note:** This method does not change the reference count of the font.

**Parameters**

- `font` (`IN PDEFont`): IN/OUT A PDEFont object returned from one of the `PDEFontCreate` methods.
- `flags` (`IN ASUns32`): IN/OUT Flags from PDSysFontMatchFlags that determine matches.
- `cosDoc` (`IN CosDoc`): IN/OUT Currently unused.

**Returns:** `void`

**Exceptions**

- `peErrFontToEmbedNotOnSys`: is raised if there is no system font that matches this PDEFont.
- `genErrBadParm`: is raised if the PDEFont is a CID font.
- `peErrCantCreateFontSubset`
- `peErrCantGetAttrs`
- `peErrCantGetWidths`

**See also:** [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDFindSysFontForPDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFontForPDEFont)

#### PDEnumSysFonts

```cpp
void PDEnumSysFonts(IN PDSysFontEnumProc enumProc, IN void *clientData)
```

Header: `PDSysFont.h:62`

Enumerates all of the system fonts with a user-supplied procedure. The PDSysFont must be acquired during the enumeration if the font is needed beyond the `enumProc`. Developers should not assume that the `enumProc` will be called. If no system fonts are found (for example, if the `PSRESOURCEPATH` environment variable is not set on UNIX platforms), `enumProc` is never called, and PDEnumSysFonts() does not raise an exception. **Note:** The font names that are returned from the methods PDEnumSysFonts() and PDSysFontGetAttrs() are different in 5.0 and later (compared to 4.05). The differences are shown in the table: Acrobat 4.05 Name Acrobat 4.05 PSname Acrobat 5.0 (and later) Name Acrobat 5.0 (and later) Psname `MS-Mincho` `NULL` `MSMincho` `MS-Mincho` `MS-Gothic` `NULL` `MSGothic` `MS-Gothic` `MS-PMincho` `NULL` `MSPMincho` `MS-PMincho` `MS-PGothic` `NULL` `MSPGothic` `MS-PGothic` `MS-UIGothic` `NULL` `MSUIGothic` `MS-UIGothic`

**Parameters**

- `enumProc` (`IN PDSysFontEnumProc`): IN/OUT A user-supplied callback to call once for each system font. Enumeration continues until all fonts have been enumerated, or until `enumProc` returns `false`.
- `clientData` (`IN void *`): IN/OUT A pointer to user-supplied data to pass to `enumProc` each time it is called.

**Returns:** `void`

**See also:** [`PDFindSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFont), [`PDFindSysFontForPDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFontForPDEFont)

#### PDFindSysFont

```cpp
PDSysFont PDFindSysFont(IN PDEFontAttrsP attrs, IN ASUns32 attrsSize, IN ASUns32 flags)
```

Header: `PDSysFont.h:80`

Finds a system font that matches the requested attributes. The method gets the PDSysFont rather than acquires it, so do not call PDERelease() on the returned PDSysFont when done with it.

**Parameters**

- `attrs` (`IN PDEFontAttrsP`): IN/OUT A pointer to a `PDEFontAttrs` structure with the attributes of the font you are searching for.
- `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrs` buffer in bytes.
- `flags` (`IN ASUns32`): IN/OUT Flags from PDSysFontMatchFlags.

**Returns:** `PDSysFont`

The desired system font.

**See also:** [`PDEnumSysFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEnumSysFonts), [`PDFindSysFontForPDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFontForPDEFont), [`PDFindSysFontEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFontEx)

#### PDFindSysFontEx

```cpp
PDSysFont PDFindSysFontEx(IN PDEFontAttrsP attrs, IN ASUns32 attrsSize, IN ASUns32 flags, OUT ASFixed *mmDesignVector, OUT ASInt32 *designVecLength)
```

Header: `PDSysFont.h:109`

Finds a system font that matches the requested attributes. If the requested font is a multiple master font instance, the base font is returned, and the specified design vector is decoded and returned in mmDesignVector. The method gets the PDSysFont rather than acquires it, so do not call PDERelease() on the returned PDSysFont when done with it.

**Parameters**

- `attrs` (`IN PDEFontAttrsP`): IN/OUT A pointer to a `PDEFontAttrs` structure with the attributes of the font you are searching for.
- `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrs` buffer in bytes.
- `flags` (`IN ASUns32`): IN/OUT Flags from PDSysFontMatchFlags.
- `mmDesignVector` (`OUT ASFixed *`): IN/OUT (Filled by the method) If the requested font is a Multiple Master font instance, the specified design vector is decoded and returned in `mmDesignVector`.
- `designVecLength` (`OUT ASInt32 *`): IN/OUT (Filled by the method) Pass the length of `mmDesignVector`. This parameter also returns the number of elements filled in `mmDesignVector` (the maximum is `4`).

**Returns:** `PDSysFont`

The desired system font.

**See also:** [`PDEnumSysFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEnumSysFonts), [`PDFindSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFont), [`PDFindSysFontForPDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFontForPDEFont)

#### PDFindSysFontForPDEFont

```cpp
PDSysFont PDFindSysFontForPDEFont(IN PDEFont font, IN ASUns32 flags)
```

Header: `PDSysFont.h:135`

Finds a system font that matches the requested PDEFont. The method gets the PDSysFont rather than acquires it, so do not call PDERelease() on the returned PDSysFont when done with it.

**Parameters**

- `font` (`IN PDEFont`): IN/OUT A PDEFont whose matching system font is found.
- `flags` (`IN ASUns32`): IN/OUT A bit field comprised of PDSysFontMatchFlags values.

  • kPDSysFontMatchNameAndCharSet

  • kPDSysFontMatchFontType

  • PDSysFontMatchFlags Passing zero matches `font` by name only.

**Returns:** `PDSysFont`

The system font corresponding to `font`.

**Exceptions**

- `peErrCantGetAttrs`
- `genErrBadParm`
- `genErrResourceLoadFailed`

**See also:** [`PDFindSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFont)

#### PDSysFontAcquirePlatformData

```cpp
PDSysFontPlatDataP PDSysFontAcquirePlatformData(IN PDSysFont sysFont)
```

Header: `PDSysFont.h:280`

Acquires platform-specific data for use by user interface code. It must be released when finished by PDSysFontReleasePlatformData().

**Parameters**

- `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font returned by either PDFindSysFont() or PDFindSysFontForPDEFont().

**Returns:** `PDSysFontPlatDataP`

A pointer to a platform-dependent structure, `PDSysFontPlatData`, containing information relating to a system font. It returns `NULL` if it is out of memory.

**See also:** [`PDSysFontReleasePlatformData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontReleasePlatformData)

#### PDSysFontGetAttrs

```cpp
void PDSysFontGetAttrs(IN PDSysFont sysFont, OUT PDEFontAttrsP attrsP, IN ASUns32 attrsSize)
```

Header: `PDSysFont.h:173`

Gets the attributes of a system font. The attributes will be returned in the buffer pointed to by `attrsP`. No more than `attrsSize` bytes will be written to the buffer. This call can be expensive to execute, as it may involve parsing the font in order to determine attributes. **Note:** The font names that are returned from the methods PDEnumSysFonts() and PDSysFontGetAttrs() are different in 5.0 and later (compared to 4.05). The differences are shown in the table: Acrobat 4.05 Name Acrobat 4.05 PSname Acrobat 5.0 (and later) Name Acrobat 5.0 (and later) Psname `MS-Mincho` `NULL` `MSMincho` `MS-Mincho` `MS-Gothic` `NULL` `MSGothic` `MS-Gothic` `MS-PMincho` `NULL` `MSPMincho` `MS-PMincho` `MS-PGothic` `NULL` `MSPGothic` `MS-PGothic` `MS-UIGothic` `NULL` `MSUIGothic` `MS-UIGothic`

**Parameters**

- `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font whose attributes are obtained.
- `attrsP` (`OUT PDEFontAttrsP`): IN/OUT (Filled by the method) A pointer to a `PDEFontAttrs` structure with the attributes of a system font.
- `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes.

**Returns:** `void`

**Exceptions**

- `peErrCantGetAttrs`

**See also:** [`PDSysFontGetEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetEncoding), [`PDSysFontGetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetInfo), [`PDSysFontGetName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetName), [`PDSysFontGetType0Widths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetType0Widths)

#### PDSysFontGetCIDSystemInfo

```cpp
void PDSysFontGetCIDSystemInfo(IN PDSysFont sysFont, OUT ASAtom *registry, OUT ASAtom *ordering, OUT ASInt32 *supplement)
```

Header: `PDSysFont.h:350`

Derives the registry, ordering, and supplement information of a multi-byte system font. This information can be used to create a PDEFont from a system font. For more information on CID fonts, see PDFontGetCIDSystemInfo().

**Parameters**

- `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a multi-byte system font.
- `registry` (`OUT ASAtom *`): IN/OUT (Filled by the method) The ASAtom representing the CIDFont's Registry information (for example, `"Adobe"`).
- `ordering` (`OUT ASAtom *`): IN/OUT (Filled by the method) The ASAtom representing the CIDFont's Ordering information (for example, `"Japan1"`).
- `supplement` (`OUT ASInt32 *`): IN/OUT (Filled by the method) The `SystemSupplement` field from the CIDFont.

**Returns:** `void`

**See also:** [`PDFontGetCIDSystemInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetCIDSystemInfo), [`PDFontGetCIDSystemSupplement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetCIDSystemSupplement)

#### PDSysFontGetCreateFlags

```cpp
ASInt32 PDSysFontGetCreateFlags(IN PDSysFont sysFont, IN PDSysEncoding sysEnc)
```

Header: `PEWProcs.h:2118`

This function returns a `createFlags` that can be passed to PDEFontCreateFromSysFontAndEncoding(). If the combination of sysFont and sysEnc is not allowed, `-1` is returned. The returned flags describe what this combination of font and encoding *requires*, not what the font's licence *permits*: `kPDEFontCreateEmbedded` may be reported for a font whose `PDEFontAttrs` report `cantEmbed`. Use PDSysFontGetAttrs() to learn what the font permits.

**Parameters**

- `sysFont` (`IN PDSysFont`): IN/OUT An object of type PDSysFont.
- `sysEnc` (`IN PDSysEncoding`): IN/OUT An object of type PDSysEncoding.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

See above.

**Exceptions**

- `peErrWrongPDEObjectType`

**See also:** [`PDSysFontGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetAttrs)

#### PDSysFontGetEncoding

```cpp
Uns8 ** PDSysFontGetEncoding(IN PDSysFont sysFont, OUT ASAtom *encodingNameP)
```

Header: `PDSysFont.h:235`

Gets the encoding of a single byte encoded system font. The returned encoding must be freed via a call to ASfree(). If the return value is zero, encodingNameP contains the name of the encoding: • For a Type 1 font, the default encoding is that specified by the Encoding value in the font dictionary. • For a TrueType font, the default encoding is that specified in the single byte CMAP table.

**Parameters**

- `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font whose encoding is obtained.
- `encodingNameP` (`OUT ASAtom *`): IN/OUT (Filled by the method) An encoding name if the return value of PDSysFontGetEncoding() is zero. If `encodingNameP` is the `NULL` ASAtom, the font uses its default encoding.

**Returns:** `Uns8 **`

An encoding array of 256 C strings. Each entry in the array either contains a glyph name or `NULL`. If it is `NULL`, the corresponding entry uses the font's built in encoding value.

**See also:** [`PDSysFontAcquirePlatformData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontAcquirePlatformData), [`PDSysFontGetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetInfo), [`PDSysFontGetName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetName), [`PDSysFontGetType0Widths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetType0Widths)

#### PDSysFontGetInfo

```cpp
void PDSysFontGetInfo(IN PDSysFont sysFont, OUT PDEFontInfoP infoP, IN ASUns32 infoSize)
```

Header: `PDSysFont.h:251`

Gets high-level information about a system font.

**Parameters**

- `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font whose information is obtained.
- `infoP` (`OUT PDEFontInfoP`): IN/OUT (Filled by the method) A pointer to `PDEFontInfoRec` structure to fill with font information for `sysFont`. No more than `infoSize` bytes are written to this buffer.
- `infoSize` (`IN ASUns32`): IN/OUT The size of the `infoP` buffer in bytes.

**Returns:** `void`

**See also:** [`PDSysFontAcquirePlatformData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontAcquirePlatformData), [`PDSysFontGetEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetEncoding), [`PDSysFontGetName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetName), [`PDSysFontGetType0Widths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetType0Widths)

#### PDSysFontGetName

```cpp
ASAtom PDSysFontGetName(IN PDSysFont sysFont)
```

Header: `PDSysFont.h:265`

Gets the PostScript or TrueType styled name for a system font.

**Parameters**

- `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font whose name is obtained.

**Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)

The ASAtom for the system font's name.

**See also:** [`PDSysFontAcquirePlatformData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontAcquirePlatformData), [`PDSysFontGetEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetEncoding), [`PDSysFontGetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetInfo), [`PDSysFontGetType0Widths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetType0Widths)

#### PDSysFontGetScript

```cpp
PDScript PDSysFontGetScript(IN PDSysFont sysFont)
```

Header: `PDSysFont.h:299`

Returns a PDScript value for the specified PDSysFont.

**Parameters**

- `sysFont` (`IN PDSysFont`): The font from which to acquire the script.

**Returns:** `PDScript`

#### PDSysFontGetType0Widths

```cpp
void PDSysFontGetType0Widths(IN PDSysFont sysFont, IN ASAtom ordering, OUT ASBool *hasDW, OUT ASInt32 *dw, OUT CosObj *w, OUT ASBool *hasDW2, OUT ASInt32 *dw2, OUT CosObj *w2)
```

Header: `PDSysFont.h:409`

Gets width information from a Type 0 system font. This information can be used to create a PDEFont from a system font. You can find this document on the web store of the International Standards Organization (ISO). You can find this document on the web store of the International Standards Organization (ISO). You can find this document on the web store of the International Standards Organization (ISO). You can find this document on the web store of the International Standards Organization (ISO). **Note:** In general, you are discouraged from using this method. Instead use PDEFontCreateFromSysFontAndEncoding() followed by PDEFontCreateWidthsNow() to create the W entry in a font.

**Parameters**

- `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a multibyte system font.
- `ordering` (`IN ASAtom`): IN/OUT An ASAtom representing the CIDFont's Ordering information. It is used to get a CMap object for `sysFont`.
- `hasDW` (`OUT ASBool *`): IN/OUT (Filled by the method) `true` if `sysFont` has a valid `dw` value; `false` otherwise.
- `dw` (`OUT ASInt32 *`): IN/OUT (Filled by the method) The default width for glyphs in a CIDFont. Currently, it is always `1000`. See the description of CIDFontType 0 in "Composite Fonts" in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7, page 267.
- `w` (`OUT CosObj *`): IN/OUT (Filled by the method) A Cos array of a set of lists that define the widths for the glyphs in the CIDFont. Each list can specify individual widths for consecutive CIDs, or one width for a range of CIDs. For information on the format of this array, see the description of CID Fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.4, page 269.
- `hasDW2` (`OUT ASBool *`): IN/OUT (Filled by the method) `true` if `sysFont` has a valid `dw2` value. The default is `false`.
- `dw2` (`OUT ASInt32 *`): IN/OUT (Filled by the method) The default metrics for writing mode 1. This entry is an array of two ASInt32 numbers: the y component of the position vector and the y component of the displacement vector for writing mode 1. The x component of the position vector is always half the width of the character. The x component of the displacement vector is always `0`. The default value is `[880-1000]`. For information on writing mode 1, see the description of CID Fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.4, page 269.
- `w2` (`OUT CosObj *`): IN/OUT (Filled by the method) A Cos array defining the metrics for vertical writing. Its format is similar to the format of the array in `w`. It defines the x and y components of the position vector, and the y component of the displacement vector. The x component of the displacement vector is always `0`. For information on the format of this array, see the description of CID Fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.4, page 269.

**Returns:** `void`

**See also:** [`PDSysFontGetWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetWidths), [`PDSysFontGetWidthsEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetWidthsEx), [`PDFontGetWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetWidths)

#### PDSysFontGetWidths

```cpp
void PDSysFontGetWidths(IN PDSysFont sysFont, OUT ASInt16 *widthsP)
```

Header: `PDSysFont.h:187`

Gets the widths of a single byte encoded system font.

**Parameters**

- `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font whose widths are obtained.
- `widthsP` (`OUT ASInt16 *`): IN/OUT (Filled by the method) A pointer to the widths array. `widthsP` must have room for 256 entries.

**Returns:** `void`

**Exceptions**

- `peErrCantGetWidths`

**See also:** [`PDSysFontGetType0Widths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetType0Widths), [`PDSysFontGetWidthsEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetWidthsEx), [`PDFontGetWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetWidths)

#### PDSysFontGetWidthsEx

```cpp
void PDSysFontGetWidthsEx(IN PDSysFont sysFont, OUT ASInt16 *widthsP, IN ASFixed *mmDesignVector)
```

Header: `PDSysFont.h:204`

Gets the widths of a single byte encoded system font.

**Parameters**

- `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font whose widths are obtained.
- `widthsP` (`OUT ASInt16 *`): IN/OUT (Filled by the method) A pointer to the widths array. `widthsP` must have room for 256 entries.
- `mmDesignVector` (`IN ASFixed *`): IN/OUT If `sysFont` is a multiple master font, it points to the design vector, whose length must equal the number of design axes of `sysFont`.

**Returns:** `void`

**Exceptions**

- `peErrCantGetWidths`

**See also:** [`PDSysFontGetType0Widths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetType0Widths), [`PDSysFontGetWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetWidths), [`PDFontGetWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetWidths)

#### PDSysFontReleasePlatformData

```cpp
void PDSysFontReleasePlatformData(IN PDSysFontPlatDataP platDataP)
```

Header: `PDSysFont.h:291`

Releases platform-specific data for the specified PDSysFont.

**Parameters**

- `platDataP` (`IN PDSysFontPlatDataP`): IN/OUT A pointer to a PDSysFontPlatDataP structure containing platform-specific data.

**Returns:** `void`

**See also:** `PDSysFontAcquirePlatformData Creates a new attribute object with the specified owner.`

#### PDSysFontVerifyEncoding

```cpp
ASInt32 PDSysFontVerifyEncoding(IN PDSysFont sysFont, IN PDSysEncoding sysEnc)
```

Header: `PEWProcs.h:2133`

Similar to PDSysFontGetCreateFlags but avoids compatibility issues with changing PDSysFontGetCreateFlags. If the combination of sysFont and sysEnc is not allowed, `-1` is returned. If the combination is ok, then `0` is returned. If the combination only works if the font is embedded, kPDEFontCreateEmbedded is returned.

**Parameters**

- `sysFont` (`IN PDSysFont`): IN/OUT An object of type PDSysFont.
- `sysEnc` (`IN PDSysEncoding`): IN/OUT An object of type PDSysEncoding.

**Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)

See above.

**Exceptions**

- `peErrWrongPDEObjectType`

### Enums (1)

#### PDSysFontPackageType

Header: `PEExpT.h:2048`

**Values**

- `kPDSysFontUnknown = 0`
- `kPDSysFontType1 = 1`
- `kPDSysFontTrueType = 2`
- `kPDSysFontCID = 3`
- `kPDSysFontATC = 4`
- `kPDSysFontOCF = 5`
- `kPDSysFontOpenTypeCFF = 6`
- `kPDSysFontOpenTypeCID = 7`
- `kPDSysFontOpenTypeTT = 8`
