Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ merge_protections:
success_conditions:
- "title ~=
^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\\(.+\
\\))?:"
\\))?(!)?:"
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pip install docling-parse
Convert a PDF (look in the [visualize.py](docling_parse/visualize.py) for a more detailed information)

```python
from docling_parse.document import SegmentedPdfPageLabel
from docling_core.types.doc.page import TextCellUnit
from docling_parse.pdf_parser import DoclingPdfParser, PdfDocument

parser = DoclingPdfParser()
Expand All @@ -78,11 +78,11 @@ pdf_doc: PdfDocument = parser.load(
for page_no, pred_page in pdf_doc.iterate_pages():

# iterate over the word-cells
for word in pred_page.yield_cells(label=SegmentedPdfPageLabel.WORD):
print(word.rect, ": ", word.text)
for word in pred_page.iterate_cells(unit_type=TextCellUnit.WORD):
print(word.rect, ": ", word.text)

# create a PIL image with the char cells
img = pred_page.render(label=SegmentedPdfPageLabel.CHAR)
# create a PIL image with the char cells
img = pred_page.render_as_image(cell_unit=TextCellUnit.CHAR)
img.show()
```

Expand Down
Loading