# org.pdfclown.documents.contents.ContentScanner Class Reference

Content objects scanner. More...

List of all members.

## Classes
class | GraphicsObjectWrapper
class | GraphicsObjectWrapper< TDataObject >
| Object information. More...
class | GraphicsState
| Graphics state [PDF:1.6:4.3]. More...
class | InlineImageWrapper
| Inline image information. More...
class | TextStringWrapper
| Text string information. More...
class | TextWrapper
| Text information. More...
class | XObjectWrapper
| External object information. More...
## Public Member Functions
| ContentScanner (xObjects::FormXObject formXObject, ContentScanner parentLevel)
| Instantiates a child-level content scanner for external form.
| ContentScanner (IContentContext contentContext)
| Instantiates a top-level content scanner.
| ContentScanner (Contents contents)
| Instantiates a top-level content scanner.
void | Insert (ContentObject obj)
| Inserts a content object at the current position.
void | Insert< T > (ICollection< T > objects)
| Inserts content objects at the current position.
bool | IsRootLevel ()
| Gets whether this level is the root of the hierarchy.
bool | Move (int index)
| Moves to the object at the given position.
void | MoveEnd ()
| Moves after the last object.
bool | MoveFirst ()
| Moves to the first object.
bool | MoveLast ()
| Moves to the last object.
bool | MoveNext ()
| Moves to the next object.
void | MoveStart ()
| Moves before the first object.
delegate void | OnStartEventHandler (ContentScanner scanner)
| Handles the scan start notification.
ContentObject | Remove ()
| Removes the content object at the current position.
void | Render (Graphics renderContext, SizeF renderSize, GraphicsPath renderObject)
| Renders the contents into the specified object.
void | Render (Graphics renderContext, SizeF renderSize)
| Renders the contents into the specified context.
## Protected Member Functions
void | NotifyStart ()
| Notifies the scan start to listeners.
## Properties
SizeF | CanvasSize`[get]`
| Gets the size of the current imageable area.
ContentScanner | ChildLevel`[get]`
| Gets the current child scan level.
IContentContext | ContentContext`[get]`
| Gets the content context associated to the content objects collection.
Contents | Contents`[get]`
| Gets the content objects collection this scanner is inspecting.
ContentObject | Current`[get, set]`
| Gets/Sets the current content object.
GraphicsObjectWrapper | CurrentWrapper`[get]`
| Gets the current content object's information.
int | Index`[get]`
| Gets the current position.
CompositeObject | Parent`[get]`
| Gets the current parent object.
ContentScanner | ParentLevel`[get]`
| Gets the parent scan level.
Graphics | RenderContext`[get]`
| Gets the rendering context.
GraphicsPath | RenderObject`[get]`
| Gets the rendering object.
ContentScanner | RootLevel`[get]`
| Gets the root scan level.
GraphicsState | State`[get]`
| Gets the current graphics state applied to the current content object.
## Events
OnStartEventHandler | OnStart
| Notifies the scan start.

##

Content objects scanner.

It wraps the content objects collection to scan its graphics state through a forward cursor.

Scanning is performed at an arbitrary deepness, according to the content objects nesting: each depth level corresponds to a scan level so that at any time it's possible to seamlessly navigate across the levels (see ParentLevel, ChildLevel).

## Constructor & Destructor Documentation

org.pdfclown.documents.contents.ContentScanner.ContentScanner | ( | Contents | contents | ) |

Instantiates a top-level content scanner.

Parameters:

  | contents | Content objects collection to scan.

org.pdfclown.documents.contents.ContentScanner.ContentScanner | ( | IContentContext | contentContext | ) |

Instantiates a top-level content scanner.

Parameters:

  | contentContext | Content context containing the content objects collection to scan.

org.pdfclown.documents.contents.ContentScanner.ContentScanner | ( | xObjects::FormXObject | formXObject,
|  | ContentScanner | parentLevel |
| ) |  |  |

Instantiates a child-level content scanner for external form.

Parameters:

  | formXObject | External form.
  | parentLevel | Parent scan level.

## Member Function Documentation

void org.pdfclown.documents.contents.ContentScanner.Insert | ( | ContentObject | obj | ) |

Inserts a content object at the current position.

void org.pdfclown.documents.contents.ContentScanner.Insert< T > | ( | ICollection< T > | objects | ) |

Inserts content objects at the current position.

After the insertion is complete, the lastly-inserted content object is at the current position.

Type Constraints

  T | : | ContentObject |

bool org.pdfclown.documents.contents.ContentScanner.IsRootLevel | ( |  | ) |

Gets whether this level is the root of the hierarchy.

bool org.pdfclown.documents.contents.ContentScanner.Move | ( | int | index | ) |

Moves to the object at the given position.

Parameters:

  | index | New position.

Returns:
  Whether the object was successfully reached.

void org.pdfclown.documents.contents.ContentScanner.MoveEnd | ( |  | ) |

Moves after the last object.

Referenced by org.pdfclown.documents.contents.objects.CompositeObject.Scan().

bool org.pdfclown.documents.contents.ContentScanner.MoveFirst | ( |  | ) |

Moves to the first object.

Returns:
  Whether the first object was successfully reached.

bool org.pdfclown.documents.contents.ContentScanner.MoveLast | ( |  | ) |

Moves to the last object.

Returns:
  Whether the last object was successfully reached.

bool org.pdfclown.documents.contents.ContentScanner.MoveNext | ( |  | ) |

Moves to the next object.

Returns:
  Whether the next object was successfully reached.

void org.pdfclown.documents.contents.ContentScanner.MoveStart | ( |  | ) |

Moves before the first object.

void org.pdfclown.documents.contents.ContentScanner.NotifyStart | ( |  | ) | `[protected]`

Notifies the scan start to listeners.

delegate void org.pdfclown.documents.contents.ContentScanner.OnStartEventHandler | ( | ContentScanner | scanner | ) |

Handles the scan start notification.

Parameters:

  | scanner | Content scanner started.

ContentObject org.pdfclown.documents.contents.ContentScanner.Remove | ( |  | ) |

Removes the content object at the current position.

Returns:
  Removed object.

void org.pdfclown.documents.contents.ContentScanner.Render | ( | Graphics | renderContext,
|  | SizeF | renderSize,
|  | GraphicsPath | renderObject |
| ) |  |  |

Renders the contents into the specified object.

Parameters:

  | renderContext | Rendering context.
  | renderSize | Rendering canvas size.
  | renderObject | Rendering object.

void org.pdfclown.documents.contents.ContentScanner.Render | ( | Graphics | renderContext,
|  | SizeF | renderSize |
| ) |  |  |

Renders the contents into the specified context.

Parameters:

  | renderContext | Rendering context.
  | renderSize | Rendering canvas size.

Referenced by org.pdfclown.documents.Page.Render(), org.pdfclown.documents.contents.xObjects.FormXObject.Render(), and org.pdfclown.documents.contents.objects.CompositeObject.Render().

## Property Documentation

SizeF org.pdfclown.documents.contents.ContentScanner.CanvasSize`[get]`

Gets the size of the current imageable area.

It can be either the user-space area (dry scanning) or the device-space area (wet scanning).

Referenced by org.pdfclown.documents.contents.objects.CompositeObject.Render(), and org.pdfclown.documents.contents.ContentScanner.GraphicsState.TextToDeviceSpace().

ContentScanner org.pdfclown.documents.contents.ContentScanner.ChildLevel`[get]`

Gets the current child scan level.

Referenced by org.pdfclown.documents.contents.objects.CompositeObject.Render().

IContentContext org.pdfclown.documents.contents.ContentScanner.ContentContext`[get]`

Gets the content context associated to the content objects collection.

Referenced by org.pdfclown.documents.contents.objects.PaintXObject.GetScanner().

Contents org.pdfclown.documents.contents.ContentScanner.Contents`[get]`

Gets the content objects collection this scanner is inspecting.

Referenced by org.pdfclown.documents.contents.entities.EAN13Barcode.ToInlineObject().

ContentObject org.pdfclown.documents.contents.ContentScanner.Current`[get, set]`

Gets/Sets the current content object.

GraphicsObjectWrapper org.pdfclown.documents.contents.ContentScanner.CurrentWrapper`[get]`

Gets the current content object's information.

int org.pdfclown.documents.contents.ContentScanner.Index`[get]`

Gets the current position.

CompositeObject org.pdfclown.documents.contents.ContentScanner.Parent`[get]`

Gets the current parent object.

Referenced by org.pdfclown.documents.contents.ContentScanner.GraphicsState.CopyTo().

ContentScanner org.pdfclown.documents.contents.ContentScanner.ParentLevel`[get]`

Gets the parent scan level.

Graphics org.pdfclown.documents.contents.ContentScanner.RenderContext`[get]`

Gets the rendering context.

Returns:

      null

  in case of dry scanning.

Referenced by org.pdfclown.documents.contents.objects.CompositeObject.Render(), org.pdfclown.documents.contents.objects.PaintPath.Scan(), and org.pdfclown.documents.contents.objects.ModifyClipPath.Scan().

GraphicsPath org.pdfclown.documents.contents.ContentScanner.RenderObject`[get]`

Gets the rendering object.

Returns:

      null

  in case of scanning outside a shape.

Referenced by org.pdfclown.documents.contents.objects.PaintPath.Scan(), and org.pdfclown.documents.contents.objects.ModifyClipPath.Scan().

ContentScanner org.pdfclown.documents.contents.ContentScanner.RootLevel`[get]`

Gets the root scan level.

GraphicsState org.pdfclown.documents.contents.ContentScanner.State`[get]`

Gets the current graphics state applied to the current content object.

Referenced by org.pdfclown.documents.contents.objects.CompositeObject.Scan().

## Event Documentation

OnStartEventHandler org.pdfclown.documents.contents.ContentScanner.OnStart

Notifies the scan start.

Copyright 2006-2013 Stefano Chizzolini. For more information, please visit PDF Clown home page.