1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 01:36:27 +00:00

fix pdf resolution

This commit is contained in:
Alex Xu
2025-07-20 09:19:06 -07:00
parent 2f03119926
commit 61bfb0a51f

View File

@@ -702,7 +702,8 @@ def render_page(vector):
for i in range(seg_from, seg_to): # work through our page segment
page = doc[i]
mat = target_height / page.rect.height
zoom = target_height / page.rect.height
mat = pymupdf.Matrix(zoom, zoom)
# TODO: decide colorspace earlier so later color check is cheaper.
pix = page.get_pixmap(matrix=mat, colorspace='RGB', alpha=False)
pix.save(os.path.join(output_dir, "p-%i.png" % i))