pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hesham Gneady" <heshamgne...@gmail.com>
Subject How to check the last character in processed stream
Date Tue, 26 Feb 2019 19:26:49 GMT
Hello ,


I am using processTextPosition(.) to read text in a PDF file. I wonder if
there is a way to know if this is the last character in the stream that it
is being processed. I need to check this in the processTextPosition(.) to
execute some code. Here is my code:


CustomStripper customStripper = new CustomStripper();

customStripper.setStartPage( 1 );

customStripper.setEndPage( 5 );

Writer w = new OutputStreamWriter( new ByteArrayOutputStream() );

customStripper.writeText( pdfDoc, w );


public class CustomStripper extends PDFTextStripper {


    public void processTextPosition( TextPosition t )  {

                           // Some processing code.

                           // I need to check if this is the last letter to
process in this stream!!!




Best regards,



This email has been checked for viruses by Avast antivirus software.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message