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      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson
Loading thread data ...

=A0 =A0 ...Jim Thompson

=A0 =A0 | =A0 =A0mens =A0 =A0 |

=A0 | =A0 =A0 et =A0 =A0 =A0|

=A0 =A0|

=A0 =A0 =A0 =A0 =A0 |

t =A0|

=A01962 =A0 =A0 |

I don't know what your PostScript files look like, but wouldn't it be a whole lot easier to just write a macro in Excel?

To your question: Sometimes I can create a PDF in some application, and it will be huge. Then, if I open it in the full version of Acrobat 5.0, and then re- save it, it will often be 10% to maybe 15% of the original file size. While saving in 5.0, I'll get several messages in the lower left that Acrobat is "removing duplicates" as well as some other messages flashing by too quickly to read.

I have no idea what it's doing in reality, as most of the time, there's nothing obviously duplicated in the source PDF document... (?) But there is no denying the final file size is much smaller, and for all intents and purposes, the files look and behave exactly the same.

So that said, I don't know if Acrobat 5.0 will help you or not.

Reply to
Mike

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
ElectroOptical Innovations
55 Orchard Rd
Briarcliff Manor NY 10510
845-480-2058
hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

Tell me more!

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
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
ElectroOptical Innovations
55 Orchard Rd
Briarcliff Manor NY 10510
845-480-2058
hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

Thanks! I'll give it a test drive.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

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      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
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
ElectroOptical Innovations
55 Orchard Rd
Briarcliff Manor NY 10510
845-480-2058
hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

Extremely buggy though. I don't know if it's changed in recent versions (last I checked, it went up to 3.0.1?), but 3.0.0 is hard to even get a plot up on the screen without one or the other crashing. It's not obvious that anything fatal has happened, but nothing works afterwards and you have to close and restart the program.

If you can twist your way around the combinations that crash, you can make some nice plots. As a Matlab clone, it does all the complex linear algebra natively, and that can be quite handy for an electronical engineer.

Tim

Reply to
Tim Williams

Try 4.3 or later. No problems.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal
ElectroOptical Innovations
55 Orchard Rd
Briarcliff Manor NY 10510
845-480-2058
hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

Sorry, you meant that Octave is buggy. I think the plot support is the weakest part--it runs M-files pretty well, but getting good plots is sometimes a bit hard.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal
ElectroOptical Innovations
55 Orchard Rd
Briarcliff Manor NY 10510
845-480-2058
hobbs at electrooptical dot net
http://electrooptical.net
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
  I do _not_ wish to receive unsolicited commercial email, and I will
     boycott any company which has the gall to send me such ads!
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.