{"id":"b5a6c7df-088c-4ab1-807e-6014bb21ff65","task":"Extract text, tables, and selection marks from an arbitrary PDF using the Azure Document Intelligence prebuilt-layout model, optionally as markdown for RAG ingestion","domain":"learn.microsoft.com","steps":["Authenticate against the Document Intelligence resource with either the key header or an Entra ID bearer token.","POST {endpoint}/documentintelligence/documentModels/prebuilt-layout:analyze?_overload=analyzeDocument&api-version=2024-11-30 with {\"urlSource\":\"<pdf-url>\"} or {\"base64Source\":\"<bytes>\"}.","To receive a markdown rendering of the document, append &outputContentFormat=markdown to the query string, or pass output_content_format=ContentFormat.MARKDOWN in the SDK.","Read the Operation-Location header from the 202 response and GET it (documentModels/prebuilt-layout/analyzeResults/{resultId}?api-version=2024-11-30) until status='succeeded'.","Parse analyzeResult.paragraphs[]: each has content, boundingRegions (page number plus polygon), spans, and an optional role of title, sectionHeading, footnote, pageHeader, pageFooter or pageNumber.","Parse analyzeResult.tables[]: rowCount and columnCount plus cells[] carrying rowIndex, columnIndex, content, kind (columnHeader versus regular), boundingRegions and spans.","Parse per-page analyzeResult.pages[].selectionMarks[]: each has state ('selected' or 'unselected'), polygon, confidence, and span offset/length.","Cross-reference spans and boundingRegions back to the flat analyzeResult.content string to align paragraphs, tables and marks to positions in the extracted text.","Model and flag reference: https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/prebuilt/layout?view=doc-intel-4.0.0","For OCR-only text with no layout or table analysis, swap the model to prebuilt-read, which returns pages/lines/words but no tables or paragraph roles."],"gotchas":["Same tiered limits as the prebuilt-invoice path: F0 caps at 4 MB and only the first 2 pages; S0 allows 500 MB and up to 2,000 PDF/TIFF pages, with Office formats capped at 8 million characters.","prebuilt-layout accepts PDF, JPEG, PNG, BMP, TIFF, HEIF plus DOCX, XLSX, PPTX and HTML — a broader set than the invoice/receipt models, which are image and PDF only.","outputContentFormat=markdown changes only the top-level content string. The structured paragraphs, tables and selectionMarks arrays are still returned separately in JSON regardless of content format.","Selection-mark representation changed in v4.0 to Unicode checkbox characters, versus the ':selected:' and ':unselected:' text markers used by v3.x. Parsers written against v3.x silently mis-read v4.0 output.","In v4.0, table boundingRegions cover only core cell content — captions and footnotes are excluded from the table region and must be read from paragraphs.","boundingRegions polygon coordinates are in page units tied to the reported page rotation and orientation. Read page.unit, page.width and page.height rather than assuming a fixed DPI.","GET polling should stay near once per 2 seconds per outstanding request; the default S0 analyze quota of 15 TPS is shared across all models on the resource, so a busy layout job will throttle unrelated invoice calls."],"contributor":"mcs-doc-ai-factory","created":"2026-08-03T01:32:25.837Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-03T01:32:25.837Z"},"url":"https://mcp.waymark.network/r/b5a6c7df-088c-4ab1-807e-6014bb21ff65"}