Skip site navigation (1) Skip section navigation (2)

PGXS problem with pdftotext

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: PGXS problem with pdftotext
Date: 2009-07-02 20:20:42
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
I've been wondering whether anyone else would want to use the
functions we wrote to extract text from PDF documents stored in bytea
columns.  If so, I would need to sort out the problems I've been
having with builds through the PGXS techniques.  Here's the directory,
after a successful build under contrib:
kgrittn(at)project-db:~/postgresql-8.3.7/contrib/pdftotext> ll
total 108
-rw-r--r-- 1 kgrittn dbas 22990 2009-04-14 17:14 libpdftotext.a
lrwxrwxrwx 1 kgrittn dbas    19 2009-04-14 17:14 ->
lrwxrwxrwx 1 kgrittn dbas    19 2009-04-14 17:14 ->
-rwxr-xr-x 1 kgrittn dbas 21666 2009-04-14 17:14
-rw-r--r-- 1 kgrittn dbas   443 2009-04-14 17:14 Makefile
-rw-r--r-- 1 kgrittn dbas  2980 2008-07-22 13:00 pdftotext.c
-rw-r--r-- 1 kgrittn dbas 14184 2009-04-14 17:14 pdftotext.o
-rw-r--r-- 1 kgrittn dbas   285 2009-04-14 17:14 pdftotext.sql
-rw-r--r-- 1 kgrittn dbas   285 2008-07-22 13:00
-rw-r--r-- 1 kgrittn dbas  4658 2009-04-13 17:02
-rw-r--r-- 1 kgrittn dbas   355 2008-07-22 13:00 poppler_compat.h
-rw-r--r-- 1 kgrittn dbas  8208 2009-04-14 17:14 poppler_compat.o
-rw-r--r-- 1 kgrittn dbas   733 2008-07-22 13:00 README.pdftotext
Here's the Makefile contents:
MODULE_big = pdftotext
OBJS = pdftotext.o poppler_compat.o
DATA_built = pdftotext.sql
DOCS = README.pdftotext

PG_CPPFLAGS =-I/usr/include/poppler -shared -fpic
SHLIB_LINK = -lpoppler -L/usr/local/lib

ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
subdir = contrib/pdftotext
top_builddir = ../..
include $(top_builddir)/src/
include $(top_srcdir)/contrib/
If we export PGXS=1 and make ; sudo make install outside the
PostgreSQL build tree, it seems to build and deploy OK, but it can't
find the poppler implementation at run time.  If we do it in the build
tree, all is good.  Where's the problem?  Is the SHLIB_LINK setting
proper?  What's the right way to do this?
BTW, libpoppler is GPL licensed, and always reminds me of what
Churchill said about democracy, if that affects anyone's interest in
the code.  You're likely to need to tweak the code based on the
particular version of libpoppler you're using.  If you use an older
version of libpoppler, it can crash the whole PostgreSQL environment
if you try to use it with a PDF using newer features.  :-(
If anyone's still interested, and I can fix the build problem, I'll
throw the source code onto pgfoundry.
"It has been said that democracy is the worst form of government
except all the others that have been tried."


pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2009-07-02 20:51:15
Subject: bug in Google translate snippet
Previous:From: Zdenek KotalaDate: 2009-07-02 19:42:07
Subject: Re: First CommitFest: July 15th

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group