# `PdfElixide.Document.BookmarkSegment`
[🔗](https://github.com/r8/pdf_elixide/blob/v0.23.0/lib/pdf_elixide/document/bookmark_segment.ex#L1)

One part of a document split at its bookmarks.

Returned by `PdfElixide.Document.bookmark_segments/2` and
`PdfElixide.Editor.bookmark_segments/2`, and paired with each part's bytes by
`PdfElixide.Editor.split_by_bookmarks/2`:

  * `:title` — the title of the bookmark that starts the segment, or `nil`
    for the front matter: the pages before the first such bookmark.
  * `:pages` — the zero-based page indices the segment covers, as an inclusive
    range. Pass it in a list to `PdfElixide.Editor.extract_page_ranges/2`, as
    in `[segment.pages]`.
  * `:file_stem` — a portable file name derived from the title, without an
    extension. Empty titles become `"untitled"`, front matter becomes
    `"front-matter"`, and collisions get a ` (2)`, ` (3)` … suffix. Stems are
    safe on common platforms, distinct on case-insensitive file systems and at
    most 80 bytes.

See [Splitting at bookmarks](guides/merging-and-splitting.md#splitting-at-bookmarks).

# `t`

```elixir
@type t() :: %PdfElixide.Document.BookmarkSegment{
  file_stem: String.t(),
  pages: Range.t(),
  title: String.t() | nil
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
