6

Java ITEXT 对 pdf 文本部分文本进行隐藏处理求助

 2 years ago
source link: https://www.v2ex.com/t/814116
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Java

Java ITEXT 对 pdf 文本部分文本进行隐藏处理求助

  yiqunz · 7 小时 3 分钟前 · 180 次点击

JAVA ITEXT 对 pdf 文本进行处理

需求:隐藏敏感数据,比如把 pdf 里的电话号码删除

问题点:目前使用白色遮挡层去实现,生成的 pdf 表面是去除了电话号码。 但是在空白区域里还是能将电话号码复制出来。

        PdfContentByte canvas = pdfStamper.getOverContent(1);
        canvas.saveState();
        //白色遮挡层
        canvas.setColorFill(BaseColor.WHITE);

不知道各位大佬有什么其他的实现方式处理


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK