Page geometry reports the crop box as the trim, bleed and art boxes (regression in 6.0.0)
Los mantenedores suelen responder en 5 días
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start in docling_parse/pdf_parser.py at _to_page_geometry_from_decoder, then inspect the Python binding for the page dimension in src/parse/page_items/page_dimension.h. The issue identifies the missing box accessors and includes a reproducer using tests/pdf_builder.py; compare its output with the expected /TrimBox coordinates. Done means both parser classes report each declared page box instead of copying the crop box; linked pull request #446 is already open.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
SegmentedPdfPage.dimension reports trim_bbox, bleed_bbox and art_bbox equal to crop_bbox on every page, even when the page declares its own /TrimBox, /BleedBox or /ArtBox.
The native parser reads the three boxes correctly (page_item<PAGE_DIMENSION>::execute in src/parse/page_items/page_dimension.h), but the Python binding only exposes get_crop_bbox and get_media_bbox, and _to_page_geometry_from_decoder in docling_parse/pdf_parser.py fills the other three fields from the crop box:
art_bbox=_to_bounding_box(crop_bbox),
media_bbox=_to_bounding_box(media_bbox),
trim_bbox=_to_bounding_box(crop_bbox),
crop_bbox=_to_bounding_box(crop_bbox),
bleed_bbox=_to_bounding_box(crop_bbox),
Up to 5.0.0, _to_page_geometry read these fields from the rectangles of the page dimension (art-bbox, bleed-bbox, trim-bbox). Since 6.0.0 they always equal the crop box. Both DoclingPdfParser and DoclingThreadedPdfParser are affected.
Steps to reproduce
from io import BytesIO
from docling_parse.pdf_parser import DoclingPdfParser
from tests.pdf_builder import build_pdf, content_stream
pdf = build_pdf([
"<< /Type /Catalog /Pages 2 0 R >>",
"<< /Type /Pages /Kids [3 0 R] /Count 1 >>",
"<< /Type /Page /Parent 2 0 R /MediaBox [0 0 300 400] /CropBox [10 10 290 390]"
" /TrimBox [20 20 280 380] /Contents 4 0 R >>",
content_stream("0 0 1 rg 50 50 100 100 re f"),
])
page = DoclingPdfParser().load(BytesIO(pdf)).get_page(1)
print(page.dimension.trim_bbox)
Expected
l=20.0 t=380.0 r=280.0 b=20.0, the page's /TrimBox.
Actual
l=10.0 t=390.0 r=290.0 b=10.0, the page's /CropBox.
Version
docling-parse 7.24.2 (current main); the same mapping exists since 6.0.0.
- Lenguaje dominante
- C++
- Estrellas
- 346
- Forks
- 92
- Merge medio
- 4 d 3 h
- PR fusionados (30 d)
- 26
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de docling-project/docling-parse
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
docling-project/docling-parse#448 ·
Los mantenedores suelen responder en 5 días
-
Text is lost when a `TJ` array is split across two content streams of a pagePosiblemente ocupada @morten-lagabote la tomó hace 2 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
docling-project/docling-parse#450 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
docling-project/docling-parse#449 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
docling-project/docling-parse#447 ·
Los mantenedores suelen responder en 5 días
-
SIGTRAP rendering a page with an MMR-coded JBIG2 image (CJBig2_GRDProc::StartDecodeMMR → FaxModule::FaxG4Decode)Posiblemente ocupada @wittjeff la tomó hace 5 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
docling-project/docling-parse#440 · 1 comentario ·
Los mantenedores suelen responder en 5 días
Todos los issues de docling-project/docling-parse
Issues similares
-
status:needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
PX4/PX4-Autopilot#29698 ·
Los mantenedores suelen responder en 1 día
-
go perft exits when EvalFile is unavailablePosiblemente ocupada @Muawiya-contact la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
official-stockfish/Stockfish#7292 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
arvidn/libtorrent#9149 ·
Los mantenedores suelen responder en 1 día
-
Upstream report: MSVC rejects a designated initializer in a dependent template argument (C2131)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
rhalbersma/tabula#72 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
esp8266/Arduino#9342 · 2 comentarios ·
Los mantenedores suelen responder en 1 día