Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3960

Spaces are ignored when reading text using TextPosition

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • 1.8.13
    • None
    • Parsing, Text extraction
    • None

    Description

      Hi,

      The following code snippet should print each character from the PDF (including Space as a character). But for some PDFs return text with missing spaces between words.

      public class PDFTextStripperProcessor extends PDFTextStripper {
      @Override
      public void processTextPosition( TextPosition text )

      { System.out.println( text.getCharacter() ); }

      }

      TextPosition getCharacter() is not returning space between words. Due to this, I am getting text without spaces. Please provide the solution to avoid missing spaces.

      Please find the Input PDF in the attachment.

      Thanks,
      Rampradeep B

      Attachments

        1. spark1.pdf
          604 kB
          Rampradeep B

        Activity

          People

            Unassigned Unassigned
            rampradeep.b@gmail.com Rampradeep B
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 72h
                72h
                Remaining:
                Remaining Estimate - 72h
                72h
                Logged:
                Time Spent - Not Specified
                Not Specified