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/04/07 18:41:41 UTC

[jira] [Comment Edited] (PDFBOX-3749) void writeString(String text, List textPositions) is not called per line

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

Tilman Hausherr edited comment on PDFBOX-3749 at 4/7/17 6:41 PM:
-----------------------------------------------------------------

Is your problem that you don't find the spaces? Here's the content stream for VOTING SUPPORT AGREEMENT:
{code}
  BT
    0 0 0 rg
    /F2 12 Tf
    1 0 0 1 220.32 708.96 Tm
    [ (V) 1.9 (O) -1.9 (T) -3.0 (ING) -241.0 (S) -4.0 (U) -8.0 (PP) 12.0 (O) -1.9 (R) 1.9 (T) -253.0 (A) -8.0 (G) 8.0 (R) 1.9 (E) -3.0 (E) -3.0 (M) 4.0 (E) -3.0 (N) 1.9 (T) ] TJ
  ET
{code}
There are no spaces in the PDF, that's why. Everything is drawn by position. You get spaces in text extraction because they are added as a guess. See attached image, which is the output of the DrawPrintTextPositions.java example.

PS: The current version is 2.0.5.


was (Author: tilman):
Is your problem that you don't find the spaces? There are none in the PDF, that's why. You get them in text extraction because they are added as a guess. See attached image, which is the output of the DrawPrintTextPositions.java example.

PS: The current version is 2.0.5.

> void writeString(String text, List<TextPosition> textPositions) is not called per line
> --------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-3749
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3749
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.4
>         Environment: Windows 10 64-bit
>            Reporter: Harun Reşit Zafer
>            Priority: Minor
>              Labels: extraction, style
>         Attachments: contract_00105_SEDAR-marked-1.png, contract_00105_SEDAR.pdf
>
>
> We overwrote the {{void writeString(String text, List<TextPosition> textPositions)}} method of the {{PDFTextStripper}} to extract additional position and style information from the PDFs. We thought this method would be called per line and the elements of the parameter {{List<TextPosition> textPositions}} would be all the letters, including the spaces in a line. 
> This is indeed the case for thousands of the documents. However, one particular document, this is not the case and the {{textPositions}} contains just the letters of a word and {{writeString}} is called per word. 
> I am not sure if this would be counted as a bug because the final extracted text is not affected. 
> The problematic PDF is attached. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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