{"record":{"id":"66fa39abe0f001a9","repo":"docling-project/docling","slug":"the-selected-backend-type-conv-res-input-backend","errorCode":null,"errorMessage":"The selected backend {type(conv_res.input._backend).__name__} for {conv_res.input.file} is not a paginated backend. Can not convert this with a paginated PDF pipeline. Please check your format configuration on DocumentConverter.","messagePattern":"The selected backend (.+?) for (.+?) is not a paginated backend\\. Can not convert this with a paginated PDF pipeline\\. Please check your format configuration on DocumentConverter\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"docling/pipeline/base_pipeline.py","lineNumber":253,"sourceCode":"        pass\n\n\nclass PaginatedPipeline(ConvertPipeline):  # TODO this is a bad name.\n    def __init__(self, pipeline_options: ConvertPipelineOptions):\n        super().__init__(pipeline_options)\n        self.keep_backend = False\n\n    def _apply_on_pages(\n        self, conv_res: ConversionResult, page_batch: Iterable[Page]\n    ) -> Iterable[Page]:\n        for model in self.build_pipe:\n            page_batch = model(conv_res, page_batch)\n\n        yield from page_batch\n\n    def _build_document(self, conv_res: ConversionResult) -> ConversionResult:\n        if not isinstance(conv_res.input._backend, PaginatedDocumentBackend):\n            raise RuntimeError(\n                f\"The selected backend {type(conv_res.input._backend).__name__} for {conv_res.input.file} is not a paginated backend. \"\n                f\"Can not convert this with a paginated PDF pipeline. \"\n                f\"Please check your format configuration on DocumentConverter.\"\n            )\n            # conv_res.status = ConversionStatus.FAILURE\n            # return conv_res\n\n        total_elapsed_time = 0.0\n        with TimeRecorder(conv_res, \"doc_build\", scope=ProfilingScope.DOCUMENT):\n            for i in range(conv_res.input.page_count):\n                start_page, end_page = conv_res.input.limits.page_range\n                if (start_page - 1) <= i <= (end_page - 1):\n                    conv_res.pages.append(Page(page_no=i + 1))\n\n            try:\n                total_pages_processed = 0\n                # Iterate batches of pages (page_batch_size) in the doc\n                for page_batch in chunkify(","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/pipeline/base_pipeline.py#L235-L271","documentation":"Paginated pipelines (StandardPdfPipeline and subclasses) build documents by iterating pages via a PaginatedDocumentBackend; _build_document asserts the input's backend is a PaginatedDocumentBackend and raises RuntimeError otherwise. It fires when a non-paginated format (HTML, MSWord, audio, image-only) is routed to a PDF-style pipeline — usually a wrong format_to_pipeline mapping in DocumentConverter.","triggerScenarios":"DocumentConverter(format_to_pipeline={InputFormat.HTML: StandardPdfPipeline}) then converting an HTML file; or a custom pipeline subclass of BasePipeline/StandardPdfPipeline whose _build_document runs on a backend like AbstractDocumentBackend that has no pagination. The message names the offending backend class and file.","commonSituations":"Copying a pipeline mapping without trimming formats; registering StandardPdfPipeline for InputFormat.AUDIO/IMAGE; custom format backends not implementing PaginatedDocumentBackend being paired with the standard PDF pipeline.","solutions":["Map only paginated formats (InputFormat.PDF, possibly DOCX via PDF backend) to the paginated pipeline and use a suitable pipeline (SimplePipeline/VerticalReadingPipeline etc.) for other formats","If you wrote a custom backend intended for this pipeline, subclass PaginatedDocumentBackend and implement load_page/page_count","Check your DocumentConverter(format_to_pipeline=...) and allowed_formats — remove the mismatched entries"],"exampleFix":"# before\nconverter = DocumentConverter(\n    allowed_formats=[InputFormat.PDF, InputFormat.HTML],\n    format_to_pipeline={InputFormat.HTML: StandardPdfPipeline},\n)\n\n# after\nconverter = DocumentConverter(\n    allowed_formats=[InputFormat.PDF, InputFormat.HTML],\n)  # default routing: HTML -> SimplePipeline","handlingStrategy":"type-guard","validationCode":"from docling.datamodel.base_models import InputFormat\n\nPAGINATED_INPUTS = {InputFormat.PDF}  # formats valid for StandardPdfPipeline\nfor fmt, pipe in format_to_pipeline.items():\n    if pipe is StandardPdfPipeline and fmt not in PAGINATED_INPUTS:\n        raise ValueError(f'{fmt} cannot use a paginated pipeline')","typeGuard":"from docling.datamodel.document import InputDocument\n\ndef has_paginated_backend(in_doc: InputDocument) -> bool:\n    from docling.datamodel.base_models import PaginatedDocumentBackend  # adjust import to version\n    return isinstance(in_doc._backend, PaginatedDocumentBackend)","tryCatchPattern":"try:\n    conv_res = converter.convert(doc)\nexcept RuntimeError as e:\n    if 'not a paginated backend' in str(e):\n        log.warning('routing %s to SimplePipeline instead', doc.file.name)\n        conv_res = fallback_converter.convert(doc)\n    else:\n        raise","preventionTips":["Rely on DocumentConverter's default format-to-pipeline routing unless you have a reason to override","When overriding, only map PDF-family formats to paginated pipelines","Custom backends intended for paginated pipelines must subclass PaginatedDocumentBackend"],"tags":["pipeline","backend","format-routing","paginated"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}