You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2017/10/11 14:31:00 UTC

[jira] [Commented] (PDFBOX-3960) Spaces are ignored when reading text using TextPosition

    [ https://issues.apache.org/jira/browse/PDFBOX-3960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16200369#comment-16200369 ] 

Tilman Hausherr commented on PDFBOX-3960:
-----------------------------------------

That's not a bug. Most PDF files don't have spaces, the words are properly positioned instead. The spaces you get with the {{ExtractText}} utility or with {{PDFTextStripper.getText()}} are created by {{PDFTextStripper}} in a later step, but they're not available as {{TextPosition}} objects.

> Spaces are ignored when reading text using TextPosition
> -------------------------------------------------------
>
>                 Key: PDFBOX-3960
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3960
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing, Text extraction
>    Affects Versions: 1.8.13
>            Reporter: Rampradeep B
>         Attachments: spark1.pdf
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> 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



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org