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

Spaces are ignored when reading text using TextPosition

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 1.8.13
    • Fix Version/s: None
    • Component/s: Parsing, Text extraction
    • Labels:
      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

            • Assignee:
              Unassigned
              Reporter:
              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