first commit: base 2024.08

Signed-off-by: maoxiaochuan <maoxiaochuan@loongson.cn>
This commit is contained in:
tao89959
2025-02-12 17:59:29 +08:00
committed by maoxiaochuan
commit f3217a7708
14356 changed files with 572894 additions and 0 deletions
@@ -0,0 +1,17 @@
import fitz_old as fitz
# Write a test PDF file
outfile = "python-pymupdf.pdf"
sample_text = "This is a test page for python-pymupdf."
doc = fitz.open()
page = doc.new_page()
p = fitz.Point(50, 72)
page.insert_text(p, sample_text)
doc.save(outfile)
# Read back the file
with fitz.open(outfile) as d: # open document
read_text = chr(12).join([page.get_text() for page in d])
print(read_text)
assert(read_text == sample_text + "\n")