public class

ContentItem

extends Object
implements AutoCloseable
java.lang.Object
   ↳ com.pdftron.pdf.struct.ContentItem

Class Overview

Content items are graphical objects that exist in the document independently of the structure tree but are associated with structure elements. Content items are leaf nodes of the structure tree.

Summary

Constants
int e_MCID The Constant e_MCID.
int e_MCR The Constant e_MCR.
int e_OBJR The Constant e_OBJR.
int e_Unknown The Constant e_Unknown.
Public Methods
void close()
Frees the native memory of the object.
void destroy()
Frees the native memory of the object.
Obj getContainingStm()
Get the containing Stream object.
int getMCID()
Get the marked-content identifier.
Page getPage()
The page on which the marked content is drawn, whether directly as part of page content or indirectly by being in a Form XObject or annotation drawn on that page.
SElement getParent()
Find the parent structure element.
Obj getRefObj()
Get the referenced object.
Obj getSDFObj()
Get the SDFObj.
Obj getStmOwner()
Get the Stream owner.
int getType()
Get the ContentItem type
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.AutoCloseable

Constants

public static final int e_MCID

The Constant e_MCID.

Constant Value: 1 (0x00000001)

public static final int e_MCR

The Constant e_MCR.

Constant Value: 0 (0x00000000)

public static final int e_OBJR

The Constant e_OBJR.

Constant Value: 2 (0x00000002)

public static final int e_Unknown

The Constant e_Unknown.

Constant Value: 3 (0x00000003)

Public Methods

public void close ()

Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.

public void destroy ()

Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.

public Obj getContainingStm ()

Get the containing Stream object.

Note: this method only applies to content items with type e_MCR.

Returns
  • The stream object that contains the marked-content sequence. The function will return a non-NULL object only if the marked-content sequence resides in a content stream other than the content stream for the page (e.g. in a form XObject).

public int getMCID ()

Get the marked-content identifier.

Note: this method only applies to content items with types e_MCR or e_MCID.

Returns
  • mcid (marked-content identifier).

public Page getPage ()

The page on which the marked content is drawn, whether directly as part of page content or indirectly by being in a Form XObject or annotation drawn on that page.

Returns
  • the page

public SElement getParent ()

Find the parent structure element.

Returns
  • parent

public Obj getRefObj ()

Get the referenced object.

Note: this method only applies to content items with type e_OBJR.

Returns
  • The referenced object.

public Obj getSDFObj ()

Get the SDFObj.

Returns
  • Pointer to the underlying SDF/Cos object.

public Obj getStmOwner ()

Get the Stream owner.

Note: this method only applies to content items with type e_MCR.

Returns
  • NULL or the PDF object owning the stream returned by GetContainingStm() (e.g. the annotation to which an appearance stream belongs).

public int getType ()

Get the ContentItem type

Returns
  • the ContentItem type.