Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

merge data with postscript

Status
Not open for further replies.

Machiaveli

Programmer
Dec 16, 2003
91
NL
Hello,

I would like to know if it is possible to use postscriptfiles to merge with data in a database.

Basically i have a table with serialnumbers which i would like to have merged in the postscriptfile. There is a dummy number in the postscript which should be replaced with each number in my table depending on how many should be printed.

Can someone show me how?
 
PostScript is a programming language. So there are as many ways to do things are there are people doing them.

You have to post a sample.

This could be trivial, or very difficult. The "dummy number" might be inside of a flate-encoded stream, for example, and so not directly visible. Or it may be drawn with the "xshow" operator, which requires a string and an array. If you change the string, you have to change the array. And so on.

So step one, stop thinking of PostScript as a "file format". It's not, it's a programming language.





Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
There is FOP, an apache libray and, I think, standalone parser, that is able to merge XSL files (XML Style Sheets, or similar) with XML data files (with them you can specify a table), and produce PS, PDF, PCL, ... files.
 
PostScript is a general purpose programming language. Many host-based PostScript interpreters can read (and write) external files. On Unix-like systems the file can be a named pipe connected to another process. So the possibilities are endless.

I recommend to use Ghostscript to convert the PS file to a static PDF snapshot of your data. The generated PDF can be later converted to PS or used directly by commercial publishers. Ghostscript can be also extended to suit your needs on C level.

You should be prepared to write your PS program by hand from beginning to end. You cannot use mainstream applications to create a template and expect to replace some strings with the variable content. The only exception is replacement of EPS files.

Your PostScript expert is just a click away.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top