Run external app from squeak

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Run external app from squeak

Sebastian Sastre-2
H there,
 
    I want to know how one can call some external application from squeak.
 
    The fact is that I want to be able to read and parse some contents in PDF files witha 3.9 squeak running on linux. I've looked the PDFReader but I cant get access to the text of the pdf with it. So, I've thought in using the pdftotext that the linux has (it converts any pdf into a text file) calling it from squeak and then access the text on the plain text file and parse it.
 
    Any clue?
 
    thanks,
 

Sebastian

 


Reply | Threaded
Open this post in threaded view
|

Re: Run external app from squeak

Tom Phoenix
On 2/4/07, Sebastian Sastre <[hidden email]> wrote:

>     I want to know how one can call some external application from squeak.

Are you looking for OSProcess? It's on SqueakMap. Hope this helps!

--Tom Phoenix

Reply | Threaded
Open this post in threaded view
|

Re: Run external app from squeak

Yanni Chiu
In reply to this post by Sebastian Sastre-2
Sebastian Sastre wrote:
>     The fact is that I want to be able to read and parse some contents in
> PDF files witha 3.9 squeak running on linux. I've looked the PDFReader but I
> cant get access to the text of the pdf with it.

I've used the PDFReader to parse telephone bills (in a prototype).
You can get the text (I can dig out more details, if you're
interested), but the results were highly dependent on the PDFs
themselves.

For example, what would appear on the printed page as a nice
table, with an informational bar on the right, might end up
being fed to the processing logic all mixed together. That is,
you get line 1 from the table, then line 1 from the information
bar, then line 2&3 of the table, because the info. bar font is
bigger. In this case, the content emerges from the PDF in top
to bottom order, without regard to logical elements on the page.
In another case (from a different company's invoice), the behaviour
was different - the content came out grouped by logical elements.

So, any approach based on extracting text from a PDF is going
to be somewhat of a guessing game. You'd have to tune your code
for the PDF examples that you can analyze.


Reply | Threaded
Open this post in threaded view
|

Re: Run external app from squeak

David T. Lewis
In reply to this post by Tom Phoenix
On Sun, Feb 04, 2007 at 08:28:07AM -0800, Tom Phoenix wrote:
> On 2/4/07, Sebastian Sastre <[hidden email]> wrote:
>
> >    I want to know how one can call some external application from squeak.
>
> Are you looking for OSProcess? It's on SqueakMap. Hope this helps!

Also load CommandShell for SqueakMap after you have loaded OSProcess. It contains
class PipeableOSProcess, which is probably what you would want to use for reading
the output of an external application.

Dave