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 视觉效果太差,而且命令行长度限制了图片文件数(一般扫描书都有几百页)。

还是要自己编程搞定。

相关推荐
淡海水23 分钟前
15-07-YooAsset面试篇-Unity性能优化与内存管理
java·unity·面试·性能优化·c#·游戏引擎
snow@li30 分钟前
Java:跨平台原理与JDK、JRE、JVM全景深度解析
java·开发语言·jvm
覆东流34 分钟前
2.Java程序基础
java·开发语言·后端
snow@li40 分钟前
SpringBoot:全套生命周期全景详解/应用级+Bean级
java·spring boot·rpc
love_muming1 小时前
二叉树操作全解析:从递归到层序遍历
java·数据结构·算法·二叉树
小的~~1 小时前
ThreadLocal 、InheritableThreadLocal 与 TransmittableThreadLocal 的进阶指南
java·开发语言
北极糊的狐1 小时前
钉钉小程序报错data.formatTime is not a function是因为 axml 模板中不能直接调用 Page 内自定义方法!
java·小程序·钉钉
·薯条大王10 小时前
经济实惠玩云服务器|一台云服务器多人共用,子账号配置教程
java·linux·运维·服务器·汇编·c++·python
ZJH__GO13 小时前
网络编程v4pro--实现聊天室文件传输功能
java·服务器·网络·计算机网络
程序员黑豆13 小时前
Windows 系统 Java 环境变量配置全攻略:解决“不是内部或外部命令”
java·前端·ai编程