使用 pdfBox 禁用 pdf 文本搜索 [英] Disable pdf-text searching with pdfBox

查看:57
本文介绍了使用 pdfBox 禁用 pdf 文本搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 pdf 文档(无格式),我想在其中禁用使用 pdfBox (java) 的文本搜索.我可以想象以下可能性:

I have a pdf document (no form) where I want to disable the text searching using pdfBox (java). Following possibilities I can imagine:

  • 拼合文本
  • 删除文本信息(不删除文本本身)
  • 向文档添加叠加层.

目前我不知道如何实现.有没有人知道如何解决这个问题?

Currently I've no idea how I can implement that. Does anyone has an idea how to solve that?

推荐答案

非常感谢您在这里提供的帮助.我想我找到了一种符合要求的方法.(老实说,不是很干净):

many thanks for your help here. I guess I found a way that fit to the requirements. (Honestly, not really clean):

  1. 将矩形添加到地址部分
  2. 将 PDF 转换为图像
  3. 将图像转换回 pdf.

虽然丢失了所有文本信息,但用户无法再看到关键信息.由于这个原因,这只是为了显示(最初的 PDF 文档没有改变),现在可以了.

While losing all text information, the user isn't able to see the critical information anymore. Due to the reason, that this is only for display (the initial PDF document doesn't get changed) this is ok for now.

这篇关于使用 pdfBox 禁用 pdf 文本搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆