Am 04.07.2017 um 10:47 schrieb lalit gupta:
Hi ,
Can you please send some demo or code if possible. I tried something around but
couldn't help.Flow will be like Read source PDFFind key or header info in
source PDFSplit PDF And find occurrence of same key word and split it .
Please don't crosspost. Post only to the users list.
You need to do two things:
- read text by page => use PDFTextStripper
|PDFTextStripper stripper = new PDFTextStripper(); stripper.setStartPage(
2 ); stripper.setEndPage( 3 ); stripper.writeText( ... ); |
- create new PDF from existing pages => just add the existing PDPage
objects from the old to your new PDDocument. Make sure not to close the
original document before the new ones are saved.
Tilman
Sent from Yahoo Mail on Android
On Tue, Jul 4, 2017 at 13:43, Gilad Denneboom<[email protected]> wrote: You can use PDFTextStripper to extract the text of each page, and if you find the word you're looking for within that text and then use the Splitter utility to extract the desired pages.
On Tue, Jul 4, 2017 at 7:39 AM, lalit gupta <[email protected]> wrote:
Hi Team, I need a help while splitting PDF . Here I want to split PDF says with
50 pages PDF into multiple PDFs.Logic should be something like I need to find a
keywords into a PDF page and need to split PDF from that location.Eg. So 50
pages PDF can be splited into multiple PDFs depends on key words.So if same key
word found on 10 times then out put will be 10 PDF from 50 PDF.And each PDF
will represent one transaction.
Thanks .
Sent from Yahoo Mail on Android