import fitz # pip install PyMuPDF
src_pdf_filename = 'LFA-WFA_Birth-24_BOYS_SET-2_EN.pdf'
dst_pdf_filename = 'LFA-WFA_Birth-24_BOYS_SET-2_EN_Edited.pdf'
document = fitz.open(src_pdf_filename)
# Get the first page
page = document[0]
# Draw a circle for a point in the upper right part of page
# http://pymupdf.readthedocs.io/en/latest/page/#Page.drawCircle
page.drawCircle(fitz.Point(517, 147), 5, color=(1, 0, 0), fill=(1, 0, 0))
# Keep original PDF; save to different PDF
document.save(dst_pdf_filename, garbage=4, clean=True, deflate=True)
document.close()
我将使用PyMuPDF在所需位置为点绘制一个圆。下面是一些示例代码:
相关问题 更多 >
编程相关推荐