Thread View: adobe.postscript.programming
4 messages
4 total messages
Started by Tim_Radle
Wed, 10 Mar 2004 20:02
Defining and rendering one-time entries
Author: Tim_Radle
Date: Wed, 10 Mar 2004 20:02
Date: Wed, 10 Mar 2004 20:02
18 lines
2105 bytes
2105 bytes
Thanks to whoever takes the time to read this. Bottom line, I'm not a PostScript programmer, and I've been given a frantic task to embed a string value that is printable into one page of our PostScript packages. I learned ASCII85 in the first couple hours of my morning today, and God willing have defined the value correctly. This is coming from a requirement that has surfaced in the last second of the last hour of a development project that has become a nitemare for me. I have to define the string "000000.0000.00.0000.000.000000000.000000", and to the best of my abilities have come up with this: <~z!!"V"!!!!O!!"V"!!!!O!!!!Ozz!%J6Oz~>. Now, I know that I have to define this string as a useable object, and I don't have the first clue where to even start. I've scoured the PS Language Reference for the past few hours and have just not found what I need to complete this task. I've seen that the page where this string is to be embedded and displayed is essentially constructed one letter at a time. I need to define this string and display it on one page only. The prolog for our PS docs is huge, and I can't find the definitions for the page in question such that I can at least program by example. I'd really appreciate some help - I'm trying to fly with lead wings at this point. Thanks for anything that you might offer. Tim
Re: Defining and rendering one-time entries
Author: Aandi_Inston
Date: Wed, 10 Mar 2004 22:06
Date: Wed, 10 Mar 2004 22:06
17 lines
1211 bytes
1211 bytes
I'm not sure where ASCII85 comes into the problem. Let's ignore that. Essentially to show text you will probably want to use the "show" operator. It may be easiest to construct your own little safe zone in the existing code rather than trying to understand it. If you add gsave initgraphics ... stuff ... grestore The stuff will be in the initial conditions and you can use findfont, scalefont, setfont, show as you would in a program of a few lines. Aandi Inston
Re: Defining and rendering one-time entries
Author: tgreer
Date: Thu, 11 Mar 2004 03:51
Date: Thu, 11 Mar 2004 03:51
32 lines
2191 bytes
2191 bytes
To amplify a bit: by "usable object", you mean a string that displays or "is drawn upon" the page, correct? You don't need ASCII85 for that. Just a regular string'll do. Strings are delimited by parens: (In PostScript, this is a string). To show the string, first define a position on the page where you want the string to be drawn. A "current point" in PostScript parlance. You do this with a code snippet as so "72 144 moveto". PostScript uses "points" as a unit, 72 points per inch. Origin is usually (by default that is to say. Your program might have altered this) in the lower left hand corner of the page. So 72 144 moveto means "1 inch from the left, 2 inches from the bottom". Then you put your string, followed by the "show" operator. As Aandi mentions, you have to have a current font. A more complete code fragment: gsave /Courier 18 selectfont 72 144 moveto (This is my string) show grestore The problem of course is where to put this code. That depends really on the nature of your existing PostScript program. If it's DSC-compliant, pages are delineated with comments, so a page might begin: %%Page: 1 1 There will be a Page Setup section. You can slip the code in right after the "%%EndPageSetup" comment for that page. If your code isn't DSC (Document Structuring Conventions), then it'll be a little more difficult. If you need more help than this, you can email me. You can find my email address on my website. Thomas D. Greer <http://www.tgreer.com>
Re: Defining and rendering one-time entries
Author: Tim_Radle
Date: Thu, 11 Mar 2004 13:55
Date: Thu, 11 Mar 2004 13:55
6 lines
1349 bytes
1349 bytes
Thanks so much to both of you for your help. It had been reiterated to me over and over that the string had to be "printable". Well, when I looked up "printable", I saw ASCII85 requirements. In fact, the vendor even agreed with me when I posed the question, "So that means this needs to be encoded in ASCII85, correct?" and then couldn't understand why I couldn't get the code to render. I truly appreciate the time that you guys have given me out of your busy days. I wish that I could help you in return in some way with one of my proficiencies. Kind Regards, Tim
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads