Skip to content

Multi-column tables collapse into unreadable single-column blobs during PDF conversion #173

Open

Description

@stevehome

Summary

When a PDF page contains a multi-column layout (e.g. a table with grouped bullet lists per cell), anydoc's Markdown table reconstruction collapses the columns into a garbled single blob, losing row/column structure and legibility.

Repro

npx -y @firecrawl/anydoc "EU AI-Act-overview-30-May-2024.pdf" -o out.md

Source PDF: https://artificialintelligenceact.eu/high-level-summary/ (also mirrored at futureoflife.org)

Observed

The source page contains an "Annex III use cases" table with ~9 category rows (Non-banned biometrics, Critical infrastructure, Education, Employment, Public/private services, Law enforcement, Migration, Administration of justice), each listing several bullet points.

anydoc's output merges all of this into a handful of malformed Markdown table rows with empty leading cells, run-together bullet text with no line breaks, and stray glyph artifacts (e.g. |||flfi fi||fififififififififi|) in several rows across the document, not just this table.

Expected behavior

Either:

  1. Reconstruct the table with correct row/column boundaries, or
  2. Fall back to emitting the cell content as reading-order text/lists (as a plain pdftotext-style extraction does successfully on the same PDF) rather than producing a broken table that's less readable than plain text.

Environment

  • @firecrawl/anydoc version: 0.2.4
  • Invocation: CLI, no --ocr flag (native PDF text extraction path — same result with --ocr hosted)
  • OS: macOS

Activity

  1. diego-coba commented on Sep 24, 2026

    @diego-coba

    It would be really nice to get this fixed. It's blocking a data extraction project I'm working on, which relies on AnyDoc for converting to Markdown before hitting an LLM. By getting a better parsing of nested tables or multi-column tables the data extraction will be more accurate for a wider array of layouts.

  2. MarcoMeyerDev commented on Sep 29, 2026

    @MarcoMeyerDev

    Same for me, if a cell has text in every new line (within the same cell), PDF parser parses the position of the cell accuratley, but it makes the text one string, loosing the structure. It must not make it one string, it must preserve the line breaks within the cell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions