Skip to content

Commit 76b51ad

Browse files
committed
readme: fix n_digits (closes #255)
Apart from that, given recent investigation, we should remove/replace the "render multiple pages concurrently" example. In general, I'm not sure if these readme examples have a future because they tend to be a maintenance burden and source of confusion.
1 parent d4c19b3 commit 76b51ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ Here are some examples of using the support model API.
109109
page_indices = page_indices,
110110
scale = 300/72, # 300dpi resolution
111111
)
112+
n_digits = len(str(n_pages))
112113
for i, image in zip(page_indices, renderer):
113-
image.save("out_%0*d.jpg" % (n_digits, i))
114+
image.save("out_%0*d.jpg" % (n_digits, i+1))
114115
```
115116
116117
* Read the table of contents
@@ -121,8 +122,7 @@ Here are some examples of using the support model API.
121122
print(
122123
" " * item.level +
123124
"[%s] %s -> %s # %s %s" % (
124-
state, item.title, target, item.view_mode,
125-
[round(c, n_digits) for c in item.view_pos],
125+
state, item.title, target, item.view_mode, item.view_pos,
126126
)
127127
)
128128
```

0 commit comments

Comments
 (0)