java:pdfbox 3.0 去除扫描版PDF中文本水印

官网下载 https://pdfbox.apache.org/download.html
下载 pdfbox-app-3.0.3.jar

cd D:\pdfbox

运行 java -jar pdfbox-app-3.0.3.jar

复制代码
java -jar pdfbox-app-3.0.3.jar
Usage: pdfbox [COMMAND] [OPTIONS]
Commands:
  debug          Analyzes and inspects the internal structure of a PDF document
  decrypt        Decrypts a PDF document
  encrypt        Encrypts a PDF document
  decode         Writes a PDF document with all streams decoded
  export:images  Extracts the images from a PDF document
  export:xmp     Extracts the xmp stream from a PDF document
  export:text    Extracts the text from a PDF document
  export:fdf     Exports AcroForm form data to FDF
  export:xfdf    Exports AcroForm form data to XFDF
  import:fdf     Imports AcroForm form data from FDF
  import:xfdf    Imports AcroForm form data from XFDF
  overlay        Adds an overlay to a PDF document
  print          Prints a PDF document
  render         Converts a PDF document to image(s)
  merge          Merges multiple PDF d*.ocuments into one
  split          Splits a PDF document into number of new documents
  fromimage      Creates a PDF document from images
  fromtext       Creates a PDF document from text
  version        Gets the version of PDFBox
  help           Display help information about the specified command.
See 'pdfbox help <command>' to read about a specific subcommand

运行 java -jar pdfbox-app-3.0.3.jar debug

导出扫描版PDF文件中每页的图片文件

java -jar pdfbox-app-3.0.3.jar export:images -prefix=test -i your_book.pdf

导出

Writing image: test-1.jpg

Writing image: test-2.jpg

Writing image: test-3.png

......

from 多个 image 合并生成 pdf

java -jar pdfbox-app-3.0.3.jar fromimage -o=book1.pdf -i=test-1.jpg -i=test-2.jpg -i=test-3.png -i=test-4.jpg

生成 book1.pdf 视觉效果太差,而且命令行长度限制了图片文件数(一般扫描书都有几百页)。

还是要自己编程搞定。

相关推荐
Howard_Stark4 分钟前
Spring的BeanFactory和FactoryBean的区别
java·后端·spring
饮长安千年月4 分钟前
学生管理系统审计
java·网络安全·代码审计
-曾牛13 分钟前
Spring Boot中@RequestParam、@RequestBody、@PathVariable的区别与使用
java·spring boot·后端·intellij-idea·注解·spring boot 注解·混淆用法
新时代苦力工25 分钟前
处理对象集合,输出Map<String, Map<String, List<MyObject>>>格式数据,无序组合键处理方法
java·数据结构·list
niesiyuan00038 分钟前
MAC如何安装多版本jdk(以8,11,17为例)
java
zcyf08091 小时前
kafka理论学习汇总
java·分布式·学习·kafka
再拼一次吧1 小时前
Spring进阶篇
java·后端·spring
爱编程的小庄1 小时前
Maven 4.0.0 模式-pom.xml配置详解
xml·java·maven
黄雪超1 小时前
JVM——引入
java·jvm
wkj0011 小时前
java 和 C#操作数据库对比
java·数据库·c#