Skip to content

Commit e9b9c39

Browse files
authored
readme: explain without_image
1 parent 68a7da0 commit e9b9c39

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,33 @@ from textract2page import convert_file
3434
convert_file("example.json", "example.jpg", "example.xml")
3535
```
3636

37+
Alternatively, if you do not have access to the image file,
38+
but do know its pixel resolution, use:
39+
40+
```python
41+
from textract2page import convert_file_without_image
42+
43+
convert_file_without_image("example.json",
44+
# just give it a name (will not be read):
45+
"example.jpg",
46+
# set image width so PAGE coordinates will be correct:
47+
2135,
48+
# set image width so PAGE coordinates will be correct:
49+
3240,
50+
"example.xml")
51+
```
52+
53+
3754
### CLI
3855

3956
Analogously, on the command line interface:
4057

58+
# with image file
4159
textract2page example.json example.jpg > example.xml
4260
textract2page -O example.xml example.json example.jpg
61+
# without image file (just its path name)
62+
textract2page --image-width 2135 --image-height 3240 example.json example.jpg > example.xml
63+
textract2page --image-width 2135 --image-height 3240 -O example.xml example.json example.jpg
4364

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

0 commit comments

Comments
 (0)