tika-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Hallett (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TIKA-2794) Tika extracts text from pdf on MacBook, but not windows server.,
Date Wed, 05 Dec 2018 13:02:00 GMT

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

Paul Hallett commented on TIKA-2794:
------------------------------------

I have just added this, not too sure if it's the right pale to add a bug.

> Tika extracts text from pdf on MacBook, but not windows server.,
> ----------------------------------------------------------------
>
>                 Key: TIKA-2794
>                 URL: https://issues.apache.org/jira/browse/TIKA-2794
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 1.19.1
>         Environment: MacBook Pro and Windows Server 2012
> This code works on the enclosed pdf file on a MacBook, but not using windows server?
>            Reporter: Paul Hallett
>            Priority: Major
>             Fix For: 2.0.0
>
>         Attachments: test2.pdf
>
>
> try:
>     headers = \{'X-Tika-PDFextractInlineImages': 'true',} # 
>     data = parser.from_file(pathtofile, serverEndpoint=self.TIKA_SERVER, headers=headers)
>     charstoreturn = data['content'].strip().split()[:limit]
>     charstoreturn = ' '.join(charstoreturn).replace("\n", " ").replace('"', "'").replace(",","").replace("'","'")
>     return True, charstoreturn
> except Exception as err:
>     return False, "error {} on file: {}.\n".format(str(err), pathtofile)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message