Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Parsing Postscript

by toadi (Chaplain)
on Jul 22, 2004 at 10:58 UTC ( #376534=perlquestion: print w/ replies, xml ) Need Help??
toadi has asked for the wisdom of the Perl Monks concerning the following question:

hi,

I've been looking around to find a module that parses postscript files. I need to parse big postscript files and get the data out of it.

But I can't find any modules it seems. Does someone here have some experience in doing this. It would be much appreciated.



--
My opinions may have changed,
but not the fact that I am right

Comment on Parsing Postscript
Re: Parsing Postscript
by herveus (Parson) on Jul 22, 2004 at 11:13 UTC
    Howdy!

    What sort of data are you looking to extract? The text? Page info?

    Your question is too vague to answer...

    I've done a tiny bit, generating a table of contents, by depending on the fairly rigid structure in the file -- something I can depend on because I control the generation of the PostScript itself.

    yours,
    Michael
      Well both. I got a big postscript page with several pages. Need to parse page info and data.


      --
      My opinions may have changed,
      but not the fact that I am right

        Howdy!

        OK. Can you be more precise about what you expect to get out of the postscript file? Your question remains exceedingly vague -- sufficient to make it unanswerable.

        Do you have any prior knowledge or control over the format of the postscript? Are there any assumptions you can make that would simplify the task of running it by a set of regexen, or something of the sort?

        yours,
        Michael
Re: Parsing Postscript
by ambrus (Abbot) on Jul 22, 2004 at 13:09 UTC

    If you install ghostscript, it will install a script called ps2ascii that executes the ps with gs and outputs the text of it. Only the text, no other info. It may give better or worse results, depending on the ps file: it works reasonably with plain English text in the ps, but not with maths formulae or international characters.

      We'll that will be a problem. Need those chars...


      --
      My opinions may have changed,
      but not the fact that I am right

Re: Parsing Postscript
by Anonymous Monk on Jul 23, 2004 at 04:09 UTC
      I used supersearch. I just wanted to know if there is any post script module or library out there I maybe missed.

      It looks like there is none, so I will roll my own.



      --
      My opinions may have changed,
      but not the fact that I am right

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://376534]
Approved by gellyfish
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2014-08-28 11:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (259 votes), past polls