Re: [xsl] parsing post script

Subject: Re: [xsl] parsing post script
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 25 Nov 2003 09:47:48 GMT
  Actually I dont need to render a PS file, but instead I've got to parse an
  existing file and try to make sense out of it, as in, I should be able to
  extract the data.

That requires a full PostScript interpretter and even _with_ a full
postscript interpreter getting a list of words out of a postscript file
is incredibly complex.

Postscript is a full featured programming language with loops, stacks,
arrays, scoping etc so to work out what the "data" is you need to execute
the program, then to work out what are the "words" you need to decide,
based on the output of that program which letters have been typeset
"close together" and in a visible colour. There is no guarantee that the
letters that appear close together on the page are anywhere near each
other in the postscript file as PS can (and often does) use absolute
coordinates to position things at arbitrary points on the page.

ghostscript includes a pstext utility to extract text: it does a
reasonable but not 100% accurate job (and includes the full ghostscript
postscript interpreter).

It is not uncommon for organisations that do this  a lot to use the
low tech, but reliable, technique of taking the postscript, printing it
on paper, and then sending the paper to an XML keyboarding house that
manually rekeys the document and emails it back.

David


-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread