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

还是要自己编程搞定。

相关推荐
七夜zippoe15 小时前
缓存三大劫攻防战:穿透、击穿、雪崩的Java实战防御体系(三)
java·开发语言·缓存
lllsure15 小时前
【Docker】镜像
java·spring cloud·docker
zhysunny15 小时前
51.不可变基础设施:云原生时代的「乐高城堡」建造法
java·云原生
无名客015 小时前
SQL语句执行时间太慢,有什么优化措施?以及衍生的相关问题
java·数据库·sql·sql语句优化
风槐啊15 小时前
邪修实战系列(3)
java·ide·spring boot·spring·tomcat
咋吃都不胖lyh15 小时前
SQL数据分析原代码--创建表与简单查询
java·数据库·sql
毕设源码-朱学姐15 小时前
【开题答辩全过程】以 _基于SpringBoot技术的“树洞”心理咨询服务平台的设计与实现为例,包含答辩的问题和答案
java·spring boot·后端
boonya15 小时前
Java内存模型与线程私有共享区域与直接内存的理解
java·开发语言·内存模型
qq_1728055915 小时前
Go 语言 PDF 生成库综合比较与实践指南
开发语言·golang·pdf
axban16 小时前
QT M/V架构开发实战:QAbstractItemModel介绍
java·数据库·qt