You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`HierarchyLevel`|`int`|Hierarchy level for container documents (read-only) * |
56
-
|`ItemIndex`|`int`|Index of current item in container documents (read-only) * |
55
+
|`HierarchyLevel`|`int`|Nesting depth of current document in container hierarchy (read-only) * |
56
+
|`ItemIndex`|`int`|Absolute sequential counter across all items (read-only) * |
57
57
58
-
\*`HierarchyLevel`and `ItemIndex` are only relevant when converting container documents (e.g., PST, OST, PDF with embedded files). For regular documents, these values are always 0 and 1.
58
+
\*`HierarchyLevel`shows nesting depth (0 = root, 1 = embedded in root, etc.). `ItemIndex` is an absolute counter (1, 2, 3...) across all items regardless of hierarchy. For regular documents, these values are always 0 and 1.
59
59
60
60
### Example
61
61
@@ -135,10 +135,10 @@ using (var converter = new Converter("quarterly-report.pdf"))
135
135
|`SourceFileName`|`string`| Name of the source file (read-only) |
136
136
|`SourceFormat`|`FileType`| Format of the source document (read-only) |
137
137
|`TargetFormat`|`string`| Target format for conversion (read-only) |
138
-
|`HierarchyLevel`|`int`|Hierarchy level for container documents (read-only) * |
139
-
|`ItemIndex`|`int`|Index of current item in container documents (read-only) * |
138
+
|`HierarchyLevel`|`int`|Nesting depth of current document in container hierarchy (read-only) * |
139
+
|`ItemIndex`|`int`|Absolute sequential counter across all items (read-only) * |
140
140
141
-
\* Only relevant for container documents (e.g., PST, OST, PDF with embedded files).
141
+
\*`HierarchyLevel` shows nesting depth (0 = root, 1 = embedded, etc.). `ItemIndex` is an absolute counter (1, 2, 3...) across all items. Only relevant for container documents (e.g., PST, OST, PDF with embedded files).
142
142
143
143
### Example
144
144
@@ -214,10 +214,10 @@ using (var converter = new Converter("contract-2024.pdf"))
214
214
|`ConvertedStream`|`Stream`| Stream containing the converted document (read-only) |
215
215
|`SourceFileName`|`string`| Name of the source file (read-only) |
216
216
|`SourceFormat`|`FileType`| Format of the source document (read-only) |
217
-
|`HierarchyLevel`|`int`|Hierarchy level for container documents (read-only) * |
218
-
|`ItemIndex`|`int`|Index of current item in container documents (read-only) * |
217
+
|`HierarchyLevel`|`int`|Nesting depth of current document in container hierarchy (read-only) * |
218
+
|`ItemIndex`|`int`|Absolute sequential counter across all items (read-only) * |
219
219
220
-
\* Only relevant for container documents (e.g., PST, OST, PDF with embedded files).
220
+
\*`HierarchyLevel` shows nesting depth (0 = root, 1 = embedded, etc.). `ItemIndex` is an absolute counter (1, 2, 3...) across all items. Only relevant for container documents (e.g., PST, OST, PDF with embedded files).
221
221
222
222
### Example
223
223
@@ -291,6 +291,26 @@ using (var converter = new Converter("monthly-report.pdf"))
291
291
292
292
The `HierarchyLevel` and `ItemIndex` properties become relevant when converting **container documents** that can hold multiple items in a hierarchical structure.
293
293
294
+
### Understanding HierarchyLevel and ItemIndex
295
+
296
+
-**HierarchyLevel**: Shows the **nesting depth** of the current document
297
+
-`0` = Root/main document
298
+
-`1` = Directly embedded in main document
299
+
-`2` = Embedded within an embedded document, etc.
300
+
301
+
-**ItemIndex**: **Absolute sequential counter** across ALL items
302
+
- Starts at 1 and increments for each item
303
+
- NOT per-hierarchy-level (it's global)
304
+
305
+
**Example hierarchy:**
306
+
```
307
+
Main PDF (Level 0, Index 1)
308
+
├─ Attachment 1 (Level 1, Index 2)
309
+
├─ Attachment 2 (Level 1, Index 3)
310
+
└─ Attachment 3 (Level 1, Index 4)
311
+
└─ Sub-attachment (Level 2, Index 5)
312
+
```
313
+
294
314
### Container Document Types
295
315
296
316
-**Email containers**: PST, OST files (Outlook data files)
@@ -330,29 +350,64 @@ using (var converter = new Converter("mailbox-archive.pst"))
330
350
### Example: PDF with Embedded Files
331
351
332
352
```csharp
353
+
// LoadContext is called for EACH document in the hierarchy
333
354
using (varconverter=newConverter(
334
355
"contract-with-attachments.pdf",
335
356
(LoadContextloadContext) =>
336
357
{
337
-
// Track hierarchy as we load
338
-
if (loadContext.HierarchyLevel>0)
358
+
// HierarchyLevel shows WHERE in the hierarchy this document is
359
+
// Level 0 = main document
360
+
// Level 1 = directly embedded in main document
361
+
// Level 2 = embedded within an embedded document, etc.
0 commit comments