# Annotation for a list of items with arbitrary length

**URL:** <https://community.labelstud.io/t/annotation-for-a-list-of-items-with-arbitrary-length/595>\
**Category:** General Discussion\
**Tags:** annotations\
**Created:** [July 10, 2025, 2:01pm UTC](https://community.labelstud.io/t/annotation-for-a-list-of-items-with-arbitrary-length/595 "2025-07-10T14:01:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jackson\_Fan](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.labelstud.io/jackson_fan/32/416_2.png) [@Jackson\_Fan](https://community.labelstud.io/u/Jackson_Fan)\
**Post date:** [July 10, 2025, 2:01pm UTC](https://community.labelstud.io/t/annotation-for-a-list-of-items-with-arbitrary-length/595/1 "2025-07-10T14:01:55Z")

</div>

Hi there,

My name is Jackson and I am currently setting up my labeling platform with LabelStudio. Our goal is rate the annotation of a multi-page PDF and each annotation has a list of sub-annotations. The length of the annotation for each page is different (hence we cannot predefine a schema and it would not be the best user experience to display empty annotation). I have looked through list, paragraph and some of your examples but didn’t find any solution. In addition, some of the annotation span multiple pages (a huge bounding box) and I am not sure how to represent that other than maybe relations.

Any help will be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![makseq](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.labelstud.io/makseq/32/26_2.png) [@makseq](https://community.labelstud.io/u/makseq)\
**Post date:** [July 10, 2025, 2:06pm UTC](https://community.labelstud.io/t/annotation-for-a-list-of-items-with-arbitrary-length/595/2 "2025-07-10T14:06:43Z")

</div>

Hello Jackson,

You can treat your PDF as a series of images and then:

1. Convert each PDF page to an image and load them as one task
2. Use the Multi-Page Document Annotation pattern (`<Image valueList>` + pagination)
3. Leverage _region-level_ controls to capture a dynamic number of “sub-annotations” per region
4. Use per-item controls (e.g. `perItem="true"`) for page-level ratings
5. Represent cross-page spans by drawing one box per page and linking them with `<RelationLabels>`

* * *

**1. Task data (JSON)**

```json
{
  "data": {
    "pages": [
      "https://…/page1.jpg",
      "https://…/page2.jpg",
      "https://…/page3.jpg"
    ]
  }
}

```

**2. Labeling config**

```xml
<View>
  <!-- A. Page-level rating -->
  <Choices name="page_rating" toName="pdf" perItem="true">
    <Choice value="✔️ Good"/>
    <Choice value="❌ Needs work"/>
  </Choices>

  <!-- B. Draw annotations on each page -->
  <RectangleLabels name="labels" toName="pdf">
    <Label value="Section"/>
  </RectangleLabels>

  <!-- C. Sub-annotations for each region (dynamic count!) -->
  <TextArea name="sub_notes"
            toName="pdf"
            perRegion="true"
            placeholder="Add sub-annotation…"/>

  <!-- D. Multi-page pagination -->
  <Image valueList="$pages" name="pdf"/>
</View>

```

- `<Image valueList="$pages">` automatically adds next/prev controls and loops over your pages.
- Users draw as many rectangles as needed on each page (no front-loaded empty fields).
- Each rectangle spawns its own `<TextArea perRegion>` instance for unlimited “sub-annotations.”
- Page ratings are handled by `perItem="true"` on `<Choices>` (or you can use `<Rating>` likewise).

**3. Spanning annotations across pages**  
To mark a logical box that covers multiple pages:

1. Draw one rectangle per relevant page.
2. Add this tag to let annotators link those rectangles:

```xml
<RelationLabels name="cross_page" toName="pdf" strokeWidth="2">
  <Label value="Continued from previous page"/>
</RelationLabels>

```

3. Annotators select two boxes (on different pages) and apply the “Continued…” relation.

* * *

**Further information:**

- Multi-Page Document Annotation template: [Label Studio Enterprise — Multi-page Document Annotation](https://docs.humansignal.com/templates/multi-page-document-annotation.html)

---

<div class="post-metadata">

**Author:** ![Jackson\_Fan](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.labelstud.io/jackson_fan/32/416_2.png) [@Jackson\_Fan](https://community.labelstud.io/u/Jackson_Fan)\
**Post date:** [July 10, 2025, 3:01pm UTC](https://community.labelstud.io/t/annotation-for-a-list-of-items-with-arbitrary-length/595/3 "2025-07-10T15:01:47Z")

</div>

Thanks so much for getting back to me so quickly Max! That all makes sense and will proceed to implementation.
