You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by Chris Mattmann <ma...@apache.org> on 2019/10/15 22:51:55 UTC
Re: [EXTERNAL] Extracting font information from xml
Hi Jay, yes, I believe so. Tika Python is just a thin client to Tika Server and it
provides this functionality. CC’ing dev@tika
From: Jay Chuk <ja...@gmail.com>
Date: Tuesday, October 15, 2019 at 3:47 PM
To: "Mattmann, Chris A (US 1761)" <ch...@jpl.nasa.gov>
Subject: [EXTERNAL] Extracting font information from xml
Hi Chris,
Thanks for provide the python package -Tika, to use for extracting text from pdf's.
I'll like to confirm it is possible when converting pdf to xml to get the font style for the text e.g the font type, if the text is bold/solid .
I need such information in identifying section headers and titles from the documents.
Please let me know if it is possible or if there is another way tp gp about this.
Thank you
Jay
Re: [EXTERNAL] Extracting font information from xml
Posted by Tim Allison <ta...@apache.org>.
We aren’t currently including font information in PDFs. I _think_ it
wouldn’t be too hard to add as <span.../> elements.
On Wed, Oct 16, 2019 at 5:37 AM Jay Chuk <ja...@gmail.com> wrote:
> Thanks Chris
> I did that already but within the tag like the paragraph tags there is no
> information on the font size or the type of font used.
>
> It only prints out the text
>
> Regards,
> Jay
>
> On Tue, Oct 15, 2019, 6:56 PM Chris Mattmann <ma...@apache.org> wrote:
>
> > When you do a parse, do this:
> >
> >
> >
> > from tika import parser
> >
> > parsed = parser.from_file(‘/path/to/file’, xmlContent=True)
> >
> > xmlContent = parsed[“content”]
> >
> > print(xmlContent)
> >
> >
> >
> > G’luck!
> >
> >
> >
> > Cheers
> > Chris
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > *From: *Jay Chuk <ja...@gmail.com>
> > *Date: *Tuesday, October 15, 2019 at 3:54 PM
> > *To: *Chris Mattmann <ma...@apache.org>
> > *Cc: *"dev@tika.apache.org" <de...@tika.apache.org>
> > *Subject: *Re: [EXTERNAL] Extracting font information from xml
> >
> >
> >
> > Thanks for the quick reply Chris.
> >
> > Please is there a possible code snippet in python for it.
> >
> >
> >
> > Reagrds,
> >
> > Jay
> >
> >
> >
> > On Tue, Oct 15, 2019 at 6:52 PM Chris Mattmann <ma...@apache.org>
> > wrote:
> >
> > Hi Jay, yes, I believe so. Tika Python is just a thin client to Tika
> > Server and it
> > provides this functionality. CC’ing dev@tika
> >
> >
> >
> >
> >
> >
> >
> > *From: *Jay Chuk <ja...@gmail.com>
> > *Date: *Tuesday, October 15, 2019 at 3:47 PM
> > *To: *"Mattmann, Chris A (US 1761)" <ch...@jpl.nasa.gov>
> > *Subject: *[EXTERNAL] Extracting font information from xml
> >
> >
> >
> > Hi Chris,
> >
> >
> >
> > Thanks for provide the python package -Tika, to use for extracting text
> > from pdf's.
> >
> >
> >
> > I'll like to confirm it is possible when converting pdf to xml to get
> the
> > font style for the text e.g the font type, if the text is bold/solid .
> >
> > I need such information in identifying section headers and titles from
> the
> > documents.
> >
> >
> >
> > Please let me know if it is possible or if there is another way tp gp
> > about this.
> >
> >
> >
> > Thank you
> >
> > Jay
> >
> >
>
Re: [EXTERNAL] Extracting font information from xml
Posted by Jay Chuk <ja...@gmail.com>.
Thanks Chris
I did that already but within the tag like the paragraph tags there is no
information on the font size or the type of font used.
It only prints out the text
Regards,
Jay
On Tue, Oct 15, 2019, 6:56 PM Chris Mattmann <ma...@apache.org> wrote:
> When you do a parse, do this:
>
>
>
> from tika import parser
>
> parsed = parser.from_file(‘/path/to/file’, xmlContent=True)
>
> xmlContent = parsed[“content”]
>
> print(xmlContent)
>
>
>
> G’luck!
>
>
>
> Cheers
> Chris
>
>
>
>
>
>
>
>
>
> *From: *Jay Chuk <ja...@gmail.com>
> *Date: *Tuesday, October 15, 2019 at 3:54 PM
> *To: *Chris Mattmann <ma...@apache.org>
> *Cc: *"dev@tika.apache.org" <de...@tika.apache.org>
> *Subject: *Re: [EXTERNAL] Extracting font information from xml
>
>
>
> Thanks for the quick reply Chris.
>
> Please is there a possible code snippet in python for it.
>
>
>
> Reagrds,
>
> Jay
>
>
>
> On Tue, Oct 15, 2019 at 6:52 PM Chris Mattmann <ma...@apache.org>
> wrote:
>
> Hi Jay, yes, I believe so. Tika Python is just a thin client to Tika
> Server and it
> provides this functionality. CC’ing dev@tika
>
>
>
>
>
>
>
> *From: *Jay Chuk <ja...@gmail.com>
> *Date: *Tuesday, October 15, 2019 at 3:47 PM
> *To: *"Mattmann, Chris A (US 1761)" <ch...@jpl.nasa.gov>
> *Subject: *[EXTERNAL] Extracting font information from xml
>
>
>
> Hi Chris,
>
>
>
> Thanks for provide the python package -Tika, to use for extracting text
> from pdf's.
>
>
>
> I'll like to confirm it is possible when converting pdf to xml to get the
> font style for the text e.g the font type, if the text is bold/solid .
>
> I need such information in identifying section headers and titles from the
> documents.
>
>
>
> Please let me know if it is possible or if there is another way tp gp
> about this.
>
>
>
> Thank you
>
> Jay
>
>
Re: [EXTERNAL] Extracting font information from xml
Posted by Chris Mattmann <ma...@apache.org>.
When you do a parse, do this:
from tika import parser
parsed = parser.from_file(‘/path/to/file’, xmlContent=True)
xmlContent = parsed[“content”]
print(xmlContent)
G’luck!
Cheers
Chris
From: Jay Chuk <ja...@gmail.com>
Date: Tuesday, October 15, 2019 at 3:54 PM
To: Chris Mattmann <ma...@apache.org>
Cc: "dev@tika.apache.org" <de...@tika.apache.org>
Subject: Re: [EXTERNAL] Extracting font information from xml
Thanks for the quick reply Chris.
Please is there a possible code snippet in python for it.
Reagrds,
Jay
On Tue, Oct 15, 2019 at 6:52 PM Chris Mattmann <ma...@apache.org> wrote:
Hi Jay, yes, I believe so. Tika Python is just a thin client to Tika Server and it
provides this functionality. CC’ing dev@tika
From: Jay Chuk <ja...@gmail.com>
Date: Tuesday, October 15, 2019 at 3:47 PM
To: "Mattmann, Chris A (US 1761)" <ch...@jpl.nasa.gov>
Subject: [EXTERNAL] Extracting font information from xml
Hi Chris,
Thanks for provide the python package -Tika, to use for extracting text from pdf's.
I'll like to confirm it is possible when converting pdf to xml to get the font style for the text e.g the font type, if the text is bold/solid .
I need such information in identifying section headers and titles from the documents.
Please let me know if it is possible or if there is another way tp gp about this.
Thank you
Jay
Re: [EXTERNAL] Extracting font information from xml
Posted by Jay Chuk <ja...@gmail.com>.
Thanks for the quick reply Chris.
Please is there a possible code snippet in python for it.
Reagrds,
Jay
On Tue, Oct 15, 2019 at 6:52 PM Chris Mattmann <ma...@apache.org> wrote:
> Hi Jay, yes, I believe so. Tika Python is just a thin client to Tika
> Server and it
> provides this functionality. CC’ing dev@tika
>
>
>
>
>
>
>
> *From: *Jay Chuk <ja...@gmail.com>
> *Date: *Tuesday, October 15, 2019 at 3:47 PM
> *To: *"Mattmann, Chris A (US 1761)" <ch...@jpl.nasa.gov>
> *Subject: *[EXTERNAL] Extracting font information from xml
>
>
>
> Hi Chris,
>
>
>
> Thanks for provide the python package -Tika, to use for extracting text
> from pdf's.
>
>
>
> I'll like to confirm it is possible when converting pdf to xml to get the
> font style for the text e.g the font type, if the text is bold/solid .
>
> I need such information in identifying section headers and titles from the
> documents.
>
>
>
> Please let me know if it is possible or if there is another way tp gp
> about this.
>
>
>
> Thank you
>
> Jay
>