PostScript Processing Question

I found a way to concatenate multiple PostScript files, add a special header and footer, and end up with a single file that can be converted to PDF.

I use this to collect data from 50 or more simulation runs onto a single graph.

Problem: Resulting PDF is HUGE, because, for example, the grid and its scales are repeated 50 or more times.

Anyone know of a cute way to find duplicates and delete them?

I have UltraEdit v14 at my disposal, though I would consider purchasing something else if it were "slick" ;-)

Thanks!

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     | 
|  Analog Innovations, Inc.                         |     et      | 
 Click to see the full signature
Reply to
Jim Thompson
Loading thread data ...

Why not output the data as ASCII and use Gnuplot to make the plots? You only need to figure out the Gnuplot script once.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal
 Click to see the full signature
Reply to
Phil Hobbs

Tell me more!

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
 Click to see the full signature
Reply to
Jim Thompson

Gnuplot is a script-driven plotting program,

formatting link
You make a script that reads an ASCII data file and plots it any way you like. Once you have it set up the way you want, you just change the name of the data files and away you go. This takes a bit of experimenting, but there are a _lot_ of examples on the website.

You can do simple data manipulation, e.g. sums, differences, products, and absolute values. If you want to do any serious processing of the data before plotting, Gnuplot is also the native plot package of GNU Octave, which is an open-source Matlab clone.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal
 Click to see the full signature
Reply to
Phil Hobbs

If you do a lot of this, i would recommend writing a program to find duplicates (and delete them). Might even take commonly used sections and write canned "subroutines" that can be called umpteen times inside the PS file (/JTscale1 {blah blah} def). As you know, these "subroutines" can also be in an external file.

Reply to
Robert Baer

What, no Windows GUI overlay ?:-)

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
 Click to see the full signature
Reply to
Jim Thompson

There's a Windows app that does the display. I usually use it under Cygwin, which has a separate X11 display program. But for making Postscript you don't need a display at all. (I use ghostview or ps2pdf from the Ghostscript package to make pdfs when needed.)

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal
 Click to see the full signature
Reply to
Phil Hobbs

As a *general* problem, I believe it's unfeasible to solve in a complete way, due to the Turing-complete nature of PostScript.

As a specific problem, for combining graphs generated by a particular program, it'll depend on how that program generates the graphs (e.g. the grids and scales). If it spits out PostScript which includes graph-and-scale-generating PostScript procs (e.g. if it has a library that it just includes) you can probably use Perl or some similar string-and-pattern-friendly language to strip out the library inclusion in all but the first image, and just re-invoke the procs in subsequent pages. On the other hand, if the program "open-codes" the graphs and scales, you'll have a more complex pattern-recognition procedure to write.

You could try running the script through Distiller or a similar PostScript-to-PostScript optimizer, and see if that helps.

--
Dave Platt                                    AE6EO 
Friends of Jade Warrior home page:  http://www.radagast.org/jade-warrior 
 Click to see the full signature
Reply to
Dave Platt

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.