Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-06

PDF indexing

9 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Santhoff

Hi,

does fpc (or lazarus) have a helper class for indexing the content of PDF files?

I want to create a searchable full text index.

TIA,
Marc

Marc Santhoff

Reply by email

Michael Van Canneyt
to Marc Santhoff
Marc Santhoff wrote
Hi, does fpc (or lazarus) have a helper class for indexing the content of PDF files?

check packages/fpindexer

I have used it to create full text searches on a database. You should be able to adapt the base code to create an index of a PDF.

Michael.

Reply by email

Marc Santhoff
to Michael Van Canneyt
Michael Van Canneyt wrote 12 lines
On Sat, 20 Jun 2015, Marc Santhoff wrote: > Hi, > > does fpc (or lazarus) have a helper class for indexing the content of > PDF files? check packages/fpindexer I have used it to create full text searches on a database. You should be able to adapt the base code to create an index of a PDF.

That looks pretty intresting. And it has some docs, wow.

If I understand correctly I'd only have to implement a class TIReaderPDF and the difference to simple text reading is the part that extracts a text stream or the text parts of the stream rejecting the pdf commands (if they are in there, need to look at PowerPDF).

Marc

Marc Santhoff

Reply by email

Michael Van Canneyt
to Marc Santhoff
Marc Santhoff wrote 20 lines
On So, 2015-06-21 at 00:33 +0200, Michael Van Canneyt wrote: > > On Sat, 20 Jun 2015, Marc Santhoff wrote: > >> Hi, >> >> does fpc (or lazarus) have a helper class for indexing the content of >> PDF files? > > check packages/fpindexer > > I have used it to create full text searches on a database. > You should be able to adapt the base code to create an index of a PDF. That looks pretty intresting. And it has some docs, wow. If I understand correctly I'd only have to implement a class TIReaderPDF and the difference to simple text reading is the part that extracts a text stream or the text parts of the stream rejecting the pdf commands (if they are in there, need to look at PowerPDF).

Yes, that would be correct.

Michael.

Reply by email

Marc Santhoff
to Michael Van Canneyt
Michael Van Canneyt wrote 25 lines
On Tue, 23 Jun 2015, Marc Santhoff wrote: > On So, 2015-06-21 at 00:33 +0200, Michael Van Canneyt wrote: >> >> On Sat, 20 Jun 2015, Marc Santhoff wrote: >> >>> Hi, >>> >>> does fpc (or lazarus) have a helper class for indexing the content of >>> PDF files? >> >> check packages/fpindexer >> >> I have used it to create full text searches on a database. >> You should be able to adapt the base code to create an index of a PDF. > > That looks pretty intresting. And it has some docs, wow. > > If I understand correctly I'd only have to implement a class TIReaderPDF > and the difference to simple text reading is the part that extracts a > text stream or the text parts of the stream rejecting the pdf commands > (if they are in there, need to look at PowerPDF). Yes, that would be correct.

Many thanks, Michael.

Currently I'm searching a pdf access library that could help doing so. The only one halfway fitting up to now is this one:

http://itextpdf.com/functionality

Open Source but a license similar to LGPL without exception. Still searching ...

Marc

Marc Santhoff

Reply by email

Michael Van Canneyt
to Marc Santhoff
Marc Santhoff wrote 36 lines
On Di, 2015-06-23 at 09:10 +0200, Michael Van Canneyt wrote: > > On Tue, 23 Jun 2015, Marc Santhoff wrote: > >> On So, 2015-06-21 at 00:33 +0200, Michael Van Canneyt wrote: >>> >>> On Sat, 20 Jun 2015, Marc Santhoff wrote: >>> >>>> Hi, >>>> >>>> does fpc (or lazarus) have a helper class for indexing the content of >>>> PDF files? >>> >>> check packages/fpindexer >>> >>> I have used it to create full text searches on a database. >>> You should be able to adapt the base code to create an index of a PDF. >> >> That looks pretty intresting. And it has some docs, wow. >> >> If I understand correctly I'd only have to implement a class TIReaderPDF >> and the difference to simple text reading is the part that extracts a >> text stream or the text parts of the stream rejecting the pdf commands >> (if they are in there, need to look at PowerPDF). > > Yes, that would be correct. Many thanks, Michael. Currently I'm searching a pdf access library that could help doing so. The only one halfway fitting up to now is this one: http://itextpdf.com/functionality Open Source but a license similar to LGPL without exception. Still searching ...

But Java or .Net.

Depending on your platform you may attempt gnostice products. It's Delphi code, but they are quite open and I was told the upcoming rework of their products will make support for Lazarus possible.

Michael.

Reply by email

Marc Santhoff
to Michael Van Canneyt
Michael Van Canneyt wrote 41 lines
On Wed, 24 Jun 2015, Marc Santhoff wrote: > On Di, 2015-06-23 at 09:10 +0200, Michael Van Canneyt wrote: >> >> On Tue, 23 Jun 2015, Marc Santhoff wrote: >> >>> On So, 2015-06-21 at 00:33 +0200, Michael Van Canneyt wrote: >>>> >>>> On Sat, 20 Jun 2015, Marc Santhoff wrote: >>>> >>>>> Hi, >>>>> >>>>> does fpc (or lazarus) have a helper class for indexing the content of >>>>> PDF files? >>>> >>>> check packages/fpindexer >>>> >>>> I have used it to create full text searches on a database. >>>> You should be able to adapt the base code to create an index of a PDF. >>> >>> That looks pretty intresting. And it has some docs, wow. >>> >>> If I understand correctly I'd only have to implement a class TIReaderPDF >>> and the difference to simple text reading is the part that extracts a >>> text stream or the text parts of the stream rejecting the pdf commands >>> (if they are in there, need to look at PowerPDF). >> >> Yes, that would be correct. > > Many thanks, Michael. > > Currently I'm searching a pdf access library that could help doing so. > The only one halfway fitting up to now is this one: > > http://itextpdf.com/functionality > > Open Source but a license similar to LGPL without exception. Still > searching ... But Java or .Net.

Really? Oops, oversight. I thought there would be a C version.

Depending on your platform you may attempt gnostice products. It's Delphi code, but they are quite open and I was told the upcoming rework of their products will make support for Lazarus possible.

I'll have a look at that one. Pure Object Pascal would be very nice.

And I found poppler, which is a fork of xpdf compiling into a library. Part of Gnome, so LGPL.

Another solution would be to use TProcess and an external tool, there are some "pdf2txt".variants out there.

Thanks again,
Marc

Marc Santhoff

Reply by email

Serguei TARASSOV
Show quoted text 33 lines
Date: Wed, 24 Jun 2015 08:47:20 +0200 From: Marc Santhoff Subject: Re: [fpc-pascal] PDF indexing Message-ID: Content-Type: text/plain; charset="ISO-8859-15" > >Currently I'm searching a pdf access library that could help doing so. > >The only one halfway fitting up to now is this one: > > > >http://itextpdf.com/functionality > > > >Open Source but a license similar to LGPL without exception. Still > >searching ... > > > >But Java or .Net. Really? Oops, oversight. I thought there would be a C version. > >Depending on your platform you may attempt gnostice products. It's Delphi code, > >but they are quite open and I was told the upcoming rework of their products > >will make support for Lazarus possible. I'll have a look at that one. Pure Object Pascal would be very nice. And I found poppler, which is a fork of xpdf compiling into a library. Part of Gnome, so LGPL. Another solution would be to use TProcess and an external tool, there are some "pdf2txt".variants out there. Thanks again, Marc -- Marc Santhoff

Marc,

Take a look on Xpdf project
"The Xpdf project also includes a PDF text extractor" http://www.foolabs.com/xpdf/about.html

A+
Serguei

Reply by email

Marc Santhoff
to Serguei TARASSOV
Serguei TARASSOV wrote 10 lines
On 24/06/2015 12:00, wrote: > Date: Wed, 24 Jun 2015 08:47:20 +0200 > From: Marc Santhoff > > Subject: Re: [fpc-pascal] PDF indexing > Message-ID: > Content-Type: text/plain; charset="ISO-8859-15" > > > >Currently I'm searching a pdf access library that could help doing so. > > >The only one halfway fitting up to now is this one:

...

Show quoted text 5 lines
Marc, Take a look on Xpdf project "The Xpdf project also includes a PDF text extractor" http://www.foolabs.com/xpdf/about.html

I know, I've found:

http://poppler.freedesktop.org/

which is a fork of it.

Thank you nonetheless,
Marc

Marc Santhoff

Reply by email