当前位置: 首页 > article >正文

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

还是要自己编程搞定。


http://www.kler.cn/news/343169.html

相关文章:

  • 电子取证新视角:Windows系统中文用户输入痕迹信息提取方法研究与实现
  • 使用Qt Creator创建项目
  • 腾讯云SDK用量统计
  • SpringBoot开发——整合Actuator监控和管理Spring Boot 应用
  • vuex安装报错
  • v-html里面的标签设置样式没有用怎么办?
  • 尚硅谷rabbitmq 2024第30-33节 死信队列 答疑
  • Linux:进程调度算法和进程地址空间
  • No.9 笔记 | PHP学习指南:从入门到精通的要点总结
  • 关于Integer和int的拆箱和装箱
  • HiRT | 异步控制策略,告别VLA时延问题
  • 【RPC】—Thrift协议 VS Protobuf
  • StringEntity 用于将字符串内容作为 HTTP 请求实体(请求体)
  • docker+mysql创建用户名密码_docker里面的mysql 更换密码
  • Linux与RTOS的区别
  • SQL第13课——创建高级联结
  • Spring Security之RememberMe
  • 美发店管理革新:SpringBoot系统的应用
  • 【低代码】前端低代码开发日记2_遇到的问题(2)变量绑定
  • python 实现BFS判断是否是二分图Bipartite算法