Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -1490,16 +1490,16 @@ void shouldInferHeadingHierarchyFromPdfNumbering() {
assertThat(headers).isNotEmpty();

// Verify that numbering-based hierarchy was applied (all headings at level 1 would be a
// failure — this PDF has sections like "3.1 PDFbackends" that should be below "3")
// failure — this PDF has sections like "3.1 PDF backends" that should be below "3")
assertThat(headers.stream().allMatch(h -> (h.getLevel() != null)))
.as("All section headers should have a level assigned")
.isTrue();
assertThat(headers.stream().map(SectionHeaderItem::getLevel).distinct().count())
.as("Multiple heading levels should be present after hierarchy inference")
.isGreaterThan(1);
// There should be at least one level-2 header (e.g. "3.1 PDFbackends")
// There should be at least one level-2 header (e.g. "3.1 PDF backends")
assertThat(headers)
.anyMatch(h -> "3.1 PDFbackends".equals(h.getText()) && (h.getLevel() >= 2));
.anyMatch(h -> "3.1 PDF backends".equals(h.getText()) && (h.getLevel() >= 2));
}

@Test
Expand Down Expand Up @@ -1753,7 +1753,7 @@ void shouldConvertSingleFileSourceWithZipTargetAsync() {
assertThat(response).isNotNull();
assertThat(response.getResponseType().equals(ResponseType.ZIP_ARCHIVE)).isTrue();
assertThat(response).isInstanceOf(ZipArchiveConvertDocumentResponse.class);
assertThat(((ZipArchiveConvertDocumentResponse) response).getFileName()).isEqualTo("converted_docs.zip");
assertThat(((ZipArchiveConvertDocumentResponse) response).getFileName()).isEqualTo("2408.09869.zip");
assertThat(((ZipArchiveConvertDocumentResponse) response).getInputStream()).isNotNull();
assertZipArchiveEntries(((ZipArchiveConvertDocumentResponse) response).getInputStream(), Set.of("2408.09869.md"));
}
Expand All @@ -1780,7 +1780,7 @@ void shouldConvertSingleFileSourceWithZipTargetAndReferencedImageExportModeAsync
assertThat(response).isNotNull();
assertThat(response.getResponseType().equals(ResponseType.ZIP_ARCHIVE)).isTrue();
assertThat(response).isInstanceOf(ZipArchiveConvertDocumentResponse.class);
assertThat(((ZipArchiveConvertDocumentResponse) response).getFileName()).isEqualTo("converted_docs.zip");
assertThat(((ZipArchiveConvertDocumentResponse) response).getFileName()).isEqualTo("2408.09869.zip");
assertThat(((ZipArchiveConvertDocumentResponse) response).getInputStream()).isNotNull();
assertZipArchiveEntries(((ZipArchiveConvertDocumentResponse) response).getInputStream(), Set
.of("2408.09869.md", "artifacts/", FIRST_IMAGE_ARTIFACT_ENTRY));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface DoclingServeContainerConfig {
/**
* Represents the version identifier for the docling-serve container image.
*/
String DOCLING_IMAGE_VERSION = "v1.35.0";
String DOCLING_IMAGE_VERSION = "v1.41.0";

/**
* Default image name
Expand Down
10 changes: 5 additions & 5 deletions docs/src/doc/docs/docling-serve/serve-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ accepts engine ids such as `"easyocr"`.

!!! warning
Not every id in the server's OpenAPI `examples` is registered in every Docling Serve build, and
that includes `"default"` — it is not guaranteed for every stage. On `v1.35.0`, for instance,
`layoutPreset("docling_layout_default")`, `tableStructurePreset("tableformer_v2")` and
`codeFormulaPreset("default")` are rejected with `Unknown ... preset`, and
`ocrPreset("tesseract")` fails unless Tesseract is installed in the image. Check what your
deployment registers before relying on any particular id.
that includes `"default"` — it is not guaranteed for every stage. On `v1.41.0`, for instance,
`layoutPreset("docling_layout_default")` is rejected with `Unknown layout preset`, and
`tableStructurePreset("tableformer_v2")` fails because its model weights are not bundled in the
image. `ocrPreset("tesseract")` fails unless Tesseract has the requested OCR language installed.
Check what your deployment registers before relying on any particular id.

A custom configuration is a `Map<String, Object>` and is an alternative to the stage's preset, not a
modifier applied on top of one. Its schema is stage-specific, and the eight stages split into two
Expand Down
1 change: 1 addition & 0 deletions docs/src/doc/docs/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Docling Java {{ gradle.project_version }} includes important breaking changes, a

### {{ gradle.project_version }}

* **`docling-testcontainers` default image bumped to `v1.41.0`** — `DoclingServeContainerConfig.DOCLING_IMAGE` now pins `ghcr.io/docling-project/docling-serve:v1.41.0` (previously `v1.35.0`). `ConvertDocumentOptions` is unchanged across this range, but one behavioral difference will show up for consumers relying on the previous default: a single-file conversion with `ZipTarget` now names the archive after the source file (e.g. `2408.09869.zip`) instead of the generic `converted_docs.zip`; multi-file conversions are unaffected. Preset registration remains image-specific — see the warning in [Per-stage presets and custom configurations](docling-serve/serve-api.md#per-stage-presets-and-custom-configurations).
* **Per-stage presets and custom configurations on `ConvertDocumentOptions`** — Eight pipeline stages (layout, OCR, table structure, picture description, picture classification, code & formula, chart extraction and the VLM pipeline) can now be tuned from Java, each through a `<stage>Preset` string or a `<stage>CustomConfig` map, for example `ocrPreset("easyocr")` or `layoutCustomConfigEntry("kind", "docling_layout_default")`. Presets are plain strings because the available ids are set by the Docling Serve deployment, so not even `"default"` is registered for every stage on every image. A custom config is a `Map<String, Object>` with a stage-specific schema, in one of two shapes: the kind-selected stages (layout, OCR, table structure, picture classification) pick an implementation through a `kind` entry, while the VLM-backed stages (picture description, code & formula, chart extraction, VLM pipeline) take `model_spec` and `engine_options` entries instead. The preset and the custom config are mutually exclusive per stage — a custom config replaces the preset rather than overriding it. These supersede `ocrEngine`, `pictureDescriptionLocal`, `pictureDescriptionApi` and the `vlmPipelineModel*` options, which Docling Serve marks as deprecated.
* **The options Docling Serve deprecates are now `@Deprecated` in Java** — `ocrEngine`, `pictureDescriptionLocal`, `pictureDescriptionApi`, `vlmPipelineModel`, `vlmPipelineModelLocal` and `vlmPipelineModelApi` carry `@Deprecated(since = "0.7.3")`, which Lombok copies onto both the getter and the builder setter, so setting one produces a compiler warning pointing at the preset or custom-config replacement. They are deliberately **not** marked `forRemoval`: these options still work, and when they are removed is Docling Serve's decision rather than this library's. The four types that are only reachable through those options — `OcrEngine`, `VlmModelType`, `PictureDescriptionLocal` and `PictureDescriptionApi` — are marked `@Deprecated` as well, so the warning also appears at `PictureDescriptionApi.builder()` rather than only at the setter.
* **New `doChartExtraction`, `includePageImages` and `mdCompactTables` options** — `doChartExtraction` extracts numeric data from charts, which had no workaround before. `includePageImages` generates full-page images, independently of `includeImages`, which covers picture elements only. `mdCompactTables` emits markdown tables without column padding, which is better for large tables and downstream processing. All three default to `false` on the server.
Expand Down