diff --git a/docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/request/options/OutputFormat.java b/docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/request/options/OutputFormat.java
index 6700a419..b23bdfb9 100644
--- a/docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/request/options/OutputFormat.java
+++ b/docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/request/options/OutputFormat.java
@@ -7,11 +7,27 @@
*/
public enum OutputFormat {
- @JsonProperty("doctags") DOCTAGS,
- @JsonProperty("html") HTML,
- @JsonProperty("html_split_page") HTML_SPLIT_PAGE,
- @JsonProperty("json") JSON,
- @JsonProperty("md") MARKDOWN,
- @JsonProperty("text") TEXT
+ @JsonProperty("dclx")
+ DCLX,
+ @JsonProperty("doctags")
+ DOCTAGS,
+ @JsonProperty("doclang")
+ DOCLANG,
+ @JsonProperty("html")
+ HTML,
+ @JsonProperty("html_split_page")
+ HTML_SPLIT_PAGE,
+ @JsonProperty("json")
+ JSON,
+ @JsonProperty("latex")
+ LATEX,
+ @JsonProperty("md")
+ MARKDOWN,
+ @JsonProperty("text")
+ TEXT,
+ @JsonProperty("vtt")
+ VTT,
+ @JsonProperty("yaml")
+ YAML
}
diff --git a/docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/response/DocumentResponse.java b/docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/response/DocumentResponse.java
index 26de6f0a..c3f29cda 100644
--- a/docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/response/DocumentResponse.java
+++ b/docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/response/DocumentResponse.java
@@ -41,6 +41,16 @@ public class DocumentResponse {
@Nullable
private String doctagsContent;
+ /**
+ * Document content in DocLang format (if requested).
+ *
+ * @param doclangContent the DocLang content, or null if not requested
+ * @return the DocLang content, or null if not requested
+ */
+ @JsonProperty("doclang_content")
+ @Nullable
+ private String doclangContent;
+
/**
* Filename of the source document.
*
@@ -97,6 +107,7 @@ public class DocumentResponse {
*
Builder methods:
*
* - {@code doctagsContent(String)} - Set the DocTags content
+ * - {@code doclangContent(String)} - Set the DocLang content
* - {@code filename(String)} - Set the filename
* - {@code htmlContent(String)} - Set the HTML content
* - {@code jsonContent(DoclingDocument)} - Set the JSON content
diff --git a/docling-serve/docling-serve-api/src/test/java/ai/docling/serve/api/convert/response/DocumentResponseTests.java b/docling-serve/docling-serve-api/src/test/java/ai/docling/serve/api/convert/response/DocumentResponseTests.java
index 5bc4adea..fa0bf8e4 100644
--- a/docling-serve/docling-serve-api/src/test/java/ai/docling/serve/api/convert/response/DocumentResponseTests.java
+++ b/docling-serve/docling-serve-api/src/test/java/ai/docling/serve/api/convert/response/DocumentResponseTests.java
@@ -18,6 +18,7 @@ class DocumentResponseTests {
@Test
void createResponseWithAllFields() {
String doctagsContent = "doctags content";
+ String doclangContent = "doclang content";
String filename = "test-document.pdf";
String htmlContent = "Test content";
DoclingDocument doclingDocument = DoclingDocument.builder()
@@ -29,6 +30,7 @@ void createResponseWithAllFields() {
DocumentResponse response = DocumentResponse.builder()
.doctagsContent(doctagsContent)
+ .doclangContent(doclangContent)
.filename(filename)
.htmlContent(htmlContent)
.jsonContent(doclingDocument)
@@ -37,6 +39,7 @@ void createResponseWithAllFields() {
.build();
assertThat(response.getDoctagsContent()).isEqualTo(doctagsContent);
+ assertThat(response.getDoclangContent()).isEqualTo(doclangContent);
assertThat(response.getFilename()).isEqualTo(filename);
assertThat(response.getHtmlContent()).isEqualTo(htmlContent);
assertThat(response.getJsonContent()).isNotNull();
@@ -51,6 +54,7 @@ void createResponseWithNullFields() {
DocumentResponse response = DocumentResponse.builder().build();
assertThat(response.getDoctagsContent()).isNull();
+ assertThat(response.getDoclangContent()).isNull();
assertThat(response.getFilename()).isNull();
assertThat(response.getHtmlContent()).isNull();
assertThat(response.getJsonContent()).isNull();
@@ -71,6 +75,7 @@ void createResponseWithEmptyFields() {
.build();
assertThat(response.getDoctagsContent()).isNull();
+ assertThat(response.getDoclangContent()).isNull();
assertThat(response.getFilename()).isEqualTo(filename);
assertThat(response.getHtmlContent()).isNull();
assertThat(response.getJsonContent()).isNull();
diff --git a/docling-serve/docling-serve-client/src/test/java/ai/docling/serve/client/AbstractDoclingServeClientTests.java b/docling-serve/docling-serve-client/src/test/java/ai/docling/serve/client/AbstractDoclingServeClientTests.java
index d49fd6ec..0ecdf3a8 100644
--- a/docling-serve/docling-serve-client/src/test/java/ai/docling/serve/client/AbstractDoclingServeClientTests.java
+++ b/docling-serve/docling-serve-client/src/test/java/ai/docling/serve/client/AbstractDoclingServeClientTests.java
@@ -1431,6 +1431,51 @@ void shouldConvertFileSuccessfully() {
assertThat(inBodyResponse.getDocument().getMarkdownContent()).isNotEmpty();
}
+ @Test
+ void shouldConvertFileWithDoclangFormatSuccessfully() {
+ var options = ConvertDocumentOptions.builder()
+ .toFormat(OutputFormat.DOCLANG)
+ .build();
+
+ var request = ConvertDocumentRequest.builder()
+ .options(options)
+ .build();
+
+ var response = getDoclingClient().convertFiles(request, Path.of("src", "test", "resources", "story.pdf"));
+ assertThat(ResponseType.IN_BODY.equals(response.getResponseType())).isTrue();
+
+ var inBodyResponse = (InBodyConvertDocumentResponse) response;
+
+ assertThat(inBodyResponse.getStatus()).isNotEmpty();
+ assertThat(inBodyResponse.getDocument()).isNotNull();
+ assertThat(inBodyResponse.getDocument().getDoclangContent()).isNotEmpty();
+ }
+
+ @Test
+ void shouldAcceptNewlySupportedOutputFormats() {
+ var options = ConvertDocumentOptions.builder()
+ .toFormat(OutputFormat.MARKDOWN)
+ .toFormat(OutputFormat.YAML)
+ .toFormat(OutputFormat.VTT)
+ .toFormat(OutputFormat.DCLX)
+ .toFormat(OutputFormat.LATEX)
+ .build();
+
+ var request = ConvertDocumentRequest.builder()
+ .options(options)
+ .build();
+
+ var response = getDoclingClient().convertFiles(request, Path.of("src", "test", "resources", "story.pdf"));
+ assertThat(ResponseType.IN_BODY.equals(response.getResponseType())).isTrue();
+
+ var inBodyResponse = (InBodyConvertDocumentResponse) response;
+
+ // Only MARKDOWN has an inline content accessor; the other requested formats
+ // are accepted by the server but have no DocumentResponse field (like HTML_SPLIT_PAGE).
+ assertThat(inBodyResponse.getStatus()).isNotEmpty();
+ assertThat(inBodyResponse.getDocument().getMarkdownContent()).isNotEmpty();
+ }
+
@Test
void shouldHandleConversionWithDifferentDocumentOptions() {
var options = ConvertDocumentOptions.builder()
diff --git a/docs/src/doc/docs/whats-new.md b/docs/src/doc/docs/whats-new.md
index f2fef60b..76a8830b 100644
--- a/docs/src/doc/docs/whats-new.md
+++ b/docs/src/doc/docs/whats-new.md
@@ -26,6 +26,7 @@ Docling Java {{ gradle.project_version }} includes important breaking changes, a
### {{ gradle.project_version }}
+* **`OutputFormat` gains `YAML`, `VTT`, `DOCLANG`, `DCLX` and `LATEX`** — These were missing from the enum, so Docling Serve rejected `toFormats`/`toFormat` requests for them even though the server supports them. `DocumentResponse` also gains a `doclangContent` accessor, mirroring `doctagsContent`/`htmlContent`/etc., since Docling Serve returns `doclang_content` inline the same way it does for the existing formats. `DCLX` has no inline content field but is exported as a file, reachable through file-based targets such as a zip archive or a presigned URL. `YAML`, `VTT`, and `LATEX` are accepted by the server's request validation but currently have no implemented export at all, inline or file — requesting them succeeds but produces nothing for those formats.
* **`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 `Preset` string or a `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` 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.