tags:

views:

238

answers:

7

What I'm trying to achieve is to determine if the Postscript that I'm parsing contains any element that resides in a table (box)... Thank you in advance...

Cheers,

RWendi

A: 

What do you mean, exactly? Are you asking whether PostScript has built-in array or hash table functionality, or are you asking whether it has a built-in way to lay out tabular data on the page?

A: 

Im asking whether if it had a built-in way to lay out tabular data on the page... My guess is that postscript doesnt have a concept of a table, cos I couldnt find it anywhere in the spec...

The problem that i need to solve is, I need to find a way to know if certain postscript lies inside a table...

Cheers,

RWendi

RWendi
Could you please edit your question to include this clarification?
William Keller
here, hear! (i don't know if it's "here, here" or "hear, hear" so this way i'm guaranteed to be 1/2 right, not all wrong) And ask a full self-contained question, not refer to the title which might be trouble for searches, viewing from other contexts etc
DarenW
+1  A: 

Short answer is no. it's a low level language for describing where to put ink on a page, no concepts of organizing it besides lines, arcs and beziers connecting x,y points put on the stack.

That said - i have written postscript by hand, and it would be smart to create variables, or arrays of x and of y values to use for aligning points. The arrays would be especially useful inside a for loop which renders the contents and draws border lines. Beware of fencepost bugs!

DarenW
A: 

dang that's bad news...

I tried running the document comparison feature in adobe 9, i had table documents where I got 2 rows being repetead in content on one document, and on the other document there's just one row... Somehow adobe is able to pick the right column and shows it as inserted/deleted... adobe must've done some kind of mapping with all the lines defined in the document to define a table...

cheers,

RWendi

RWendi
+2  A: 

Sounds like you are trying to draw something and test if any part of draws within some specified box. You can create a path for the thing to be tested (just don't stroke or fill it), and create another path for the box (e.g. a table cell). Leave these two paths on the stack, and use one of the operators inufill, inustroke, etc.

If you happen to have the Postscript Language Reference 3rd edition, the goodies are listed under "Insideness-Testing Operators" on p. 520, with details in the alphabetical section following that.

DarenW
A: 

Thanks DarrenW, that should be usefull...

Not trying to draw anything... What Im trying to do is to determine if the postscript that im parsing contains any element that resides in a table (box)...

Cheers,

Rwendi

RWendi
A: 

Hmm... that's a potentially tricky one... are you trying to do this on arbitrary PostScript files, or do you have some a priori knowledge of their layout and structure? Due to the extremely low-level nature of PostScript, I suspect that any solution you come up with will be very document-specific.