(page, textout, GRID, fontsize, noformfeed, skip_empty, flags)
| 553 | |
| 554 | |
| 555 | def page_simple(page, textout, GRID, fontsize, noformfeed, skip_empty, flags): |
| 556 | eop = b"\n" if noformfeed else bytes([12]) |
| 557 | text = page.get_text("text", flags=flags) |
| 558 | if not text: |
| 559 | if not skip_empty: |
| 560 | textout.write(eop) # write formfeed |
| 561 | return |
| 562 | textout.write(text.encode("utf8", errors="surrogatepass")) |
| 563 | textout.write(eop) |
| 564 | return |
| 565 | |
| 566 | |
| 567 | def page_blocksort(page, textout, GRID, fontsize, noformfeed, skip_empty, flags): |