> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encord.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Objects.spaces.multiframe space.pdf space

## PdfSpace Objects

```python theme={"dark"}
class PdfSpace(MultiFrameSpace)
```

PDF space implementation for page-based annotations.

This class provides a page-centric API for PDF annotations, using 'pages' terminology
instead of 'frames' for all public methods.

#### put\_object\_instance

```python theme={"dark"}
def put_object_instance(object_instance: ObjectInstance,
                        pages: Frames,
                        coordinates: GeometricCoordinates,
                        *,
                        on_overlap: FrameOverlapStrategy = "error",
                        created_at: Optional[datetime] = None,
                        created_by: Optional[str] = None,
                        last_edited_at: Optional[datetime] = None,
                        last_edited_by: Optional[str] = None,
                        confidence: Optional[float] = None,
                        manual_annotation: Optional[bool] = None) -> None
```

Add an object instance to specific pages in the PDF.

**Arguments**:

* `object_instance` - The object instance to add to the PDF.
* `pages` - Page numbers or ranges where the object should appear. Can be:
  * A single page number (int)
  * A list of page numbers (List\[int])
  * A Range object, specifying the start and end of the range (Range)
  * A list of Range objects for multiple ranges (List\[Range])
* `coordinates` - Geometric coordinates for the object (e.g., bounding box, polygon, polyline).
* `on_overlap` - Strategy for handling existing annotations on the same pages.
  * "error" (default): Raises an error if annotation already exists.
  * "replace": Overwrites existing annotations on overlapping pages.
* `created_at` - Optional timestamp when the annotation was created.
* `created_by` - Optional identifier of who created the annotation.
* `last_edited_at` - Optional timestamp when the annotation was last edited.
* `last_edited_by` - Optional identifier of who last edited the annotation.
* `confidence` - Optional confidence score for the annotation (0.0 to 1.0).
* `manual_annotation` - Optional flag indicating if this was manually annotated.

**Raises**:

* `LabelRowError` - If pages are invalid or if annotation already exists when on\_overlap="error".

#### put\_classification\_instance

```python theme={"dark"}
def put_classification_instance(
        classification_instance: ClassificationInstance,
        pages: Optional[Frames] = None,
        *,
        on_overlap: Optional[FrameOverlapStrategy] = "error",
        created_at: Optional[datetime] = None,
        created_by: Optional[str] = None,
        last_edited_at: Optional[datetime] = None,
        last_edited_by: Optional[str] = None,
        confidence: Optional[float] = None,
        manual_annotation: Optional[bool] = None) -> None
```

Add a classification instance to specific pages in the PDF.

**Arguments**:

* `classification_instance` - The classification instance to add to the PDF.
* `pages` - Page numbers or ranges where the classification should appear. Can be:
  * A single page number (int)
  * A list of page numbers (List\[int])
  * A Range object, specifying the start and end of the range (Range)
  * A list of Range objects for multiple ranges (List\[Range])
    For global classifications, set this to None.
* `on_overlap` - Strategy for handling existing classifications on the same pages.
  * "error" (default): Raises an error if classification already exists.
  * "replace": Overwrites existing classifications on overlapping pages.
* `created_at` - Optional timestamp when the annotation was created.
* `created_by` - Optional identifier of who created the annotation.
* `last_edited_at` - Optional timestamp when the annotation was last edited.
* `last_edited_by` - Optional identifier of who last edited the annotation.
* `confidence` - Optional confidence score for the annotation (0.0 to 1.0).
* `manual_annotation` - Optional flag indicating if this was manually annotated.

**Raises**:

* `LabelRowError` - If pages are invalid or if classification already exists when on\_overlap="error".

#### remove\_object\_instance

```python theme={"dark"}
def remove_object_instance(
        object_hash: str,
        pages: Optional[Frames] = None) -> Optional[ObjectInstance]
```

Remove an object instance from pages on the pdf space. If no pages are provided, the object instance is removed
from ALL pages in the pdf.

**Arguments**:

* `object_hash` - The hash identifier of the object instance to remove.
* `pages` - The pages the object instance is to be removed from.

**Returns**:

* `Optional[ObjectInstance]` - The removed object instance, or None if the object wasn't found.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.