Forgot password?
 Create new account
View 169|Reply 0

PDF修改文字

[Copy link]

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

hbghlyj Posted at 2023-7-2 07:50:07 |Read mode
这里第2页ployder是打错了。应该为polyder Screenshot 2023-07-01 024713.png
用PyMupdf修改:
  1. import fitz
  2. doc = fitz.open("MATLAB07_Poly.pdf")
  3. page = doc[1]
  4. xref = page.get_contents()[0]
  5. doc.update_stream(xref,doc.xref_stream(xref).replace(b'ployder',b'polyder'))
  6. doc.save("output.pdf", garbage=4, deflate=True, clean=True)
Copy the Code
效果: Screenshot 2023-07-01 024713.png

手机版Mobile version|Leisure Math Forum

2025-4-20 21:57 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list