Skip to content

Commit

Permalink
readme: explain without_image
Browse files Browse the repository at this point in the history
  • Loading branch information
bertsky authored Feb 3, 2025
1 parent 68a7da0 commit e9b9c39
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,33 @@ from textract2page import convert_file
convert_file("example.json", "example.jpg", "example.xml")
```

Alternatively, if you do not have access to the image file,
but do know its pixel resolution, use:

```python
from textract2page import convert_file_without_image

convert_file_without_image("example.json",
# just give it a name (will not be read):
"example.jpg",
# set image width so PAGE coordinates will be correct:
2135,
# set image width so PAGE coordinates will be correct:
3240,
"example.xml")
```


### CLI

Analogously, on the command line interface:

# with image file
textract2page example.json example.jpg > example.xml
textract2page -O example.xml example.json example.jpg
# without image file (just its path name)
textract2page --image-width 2135 --image-height 3240 example.json example.jpg > example.xml
textract2page --image-width 2135 --image-height 3240 -O example.xml example.json example.jpg

You can get a list of options with `--help` or `-h`

Expand Down

0 comments on commit e9b9c39

Please sign in to comment.