Skip to main content
Version: API v2 Preview

ObjectRef

Kind: class
Module/package: models
SDK: pdfdancer-client-python 2.0.0

Reference to an object in a PDF document returned by the server.

Parameters:

  • internal_id: Server-side identifier for the object.
  • position: Position information describing where the object is.
  • type: Object type (see ObjectType).

Usage:

  • Instances are typically returned in snapshots or find results.
  • Pass an ObjectRef to request objects such as MoveRequest, DeleteRequest, DeleteRequest, MoveRequest, or ModifyRequest.

Example:

# Move an object to a new position
new_pos = Position.at_page_coordinates(0, 120, 500)
payload = MoveRequest(object_ref=obj_ref, position=new_pos).to_dict()

Declaration

ObjectRef(internal_id: str, position: pdfdancer.models.Position, type: pdfdancer.models.ObjectType) -> None

Members

__init__

__init__(self, internal_id: str, position: pdfdancer.models.Position, type: pdfdancer.models.ObjectType) -> None

Initialize self. See help(type(self)) for accurate signature.

get_internal_id

get_internal_id(self) -> str

Returns the internal identifier for the referenced object.

get_position

get_position(self) -> pdfdancer.models.Position

Returns the current position information for the referenced object.

get_type

get_type(self) -> pdfdancer.models.ObjectType

Returns the type classification of the referenced object.

set_position

set_position(self, position: pdfdancer.models.Position) -> None

Updates the position information for the referenced object.

to_dict

to_dict(self) -> Dict[str, Any]

Convert to dictionary for JSON serialization.

object_type

object_type: pdfdancer.models.ObjectType

Return the object type using the public object naming convention.

View source at af2a1171a1b9