Forgot password
 Register account
View 272|Reply 0

PDF修改文字

[Copy link]

3218

Threads

7837

Posts

52

Reputation

Show all posts

hbghlyj posted 2023-7-2 07:50 |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

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-7-21 11:42 GMT+8

Powered by Discuz!

Processed in 0.020594 seconds, 46 queries