英文:
How to create a copy of a PDF file with PDFBox with a filter?
问题
我有一个PDF文件(假设为A.pdf),想要创建该文件的副本(B.pdf)。
但是在复制文件时,我想要跳过一些文本。
例如,A.pdf中有文本“Hello World”,我将跳过文本“Hello”,最终B.pdf将只剩下“World”。
编辑:单词“World”将保持在原处,不会发生移动。
我尝试使用PDFTextStripper
类解决了这个问题,但文本仍然保持不变。
我对PDFBox相当新,并且正在使用版本2。
谢谢。
英文:
I have a PDF file file (say A.pdf) and would like to create a copy of that file (B.pdf).
But I would like to skip some text when I copy the file.
For example A.pdf has a text of Hello World
and I will skip the text Hello
and eventually B.pdf will have World
only.
Edit: The word World
shall stay where it is and it is not going to shift.
I tried to solve that problem using PDFTextStripper
class but the text remained same. I'm quite new to the PDFBox and using version 2.
Thanks.
专注分享java语言的经验与见解,让所有开发者获益!
评论