
Hello All, Responding to a couple of responses from Robin, but with information for all. On Sat, 2014-03-15 at 11:12 -0400, Robin Humble wrote:
On Mon, Mar 10, 2014 at 12:31:30PM +1100, Mark Trickett wrote:
I have a Postscript calendar program which I use to print out a calendar I can put up on a wall for planning purposes. From what I have seen, a clipping box should not "appear", but it does with the following code. For the interested, I can email the main calendar code as well, but not included here for brevity. There are two routines, callmonth and calendar defined prior in the one file. If you have other suggestions, I will read with interest, it is all a learning exercise, but with a practical useful result.
your clip code seems to work ok for me. what is inside the clip boundaries should appear and the rest shouldn't. your margin coordinates setup the clip region to be almost the whole page, so you should be drawing everywhere except a 20pt ~= 0.7cm blank white boundary. that's what happens when I add your clip code as a fn to a .ps file of mine and look at it in evince (+/- evince using Letter for some reason instead of A4). I don't get a line drawn around the clip path.
I wished to use the printable page, or at least most of that, and have the printed pages being joined after printing. It does require trimming or folding one of the sheets. I wanted there to be no duplication so that the abutment is more apparent to certain parties, and easier to join given that it is not possible to print right to the edge of the paper, at least on my printers. What worked to remove the line of the clipping box was adding a newpath operator following the clip operator. The subsequent parts "stroked" various lines and "show" was invoked on text, which meant that the clipping box was also "stroked", but with the outer half of the line clipped, with the resulting line looking to be half width. There were reasons that it was appropriate that the clipping was not a function, this time. A brief comment for Robin, the variant you emailed back, the invocation of the clipping function was commented out, that is what the "%" does in Postscript.
BTW, my postscript is very rusty, but if you previously define a "callmonth" fn then isn't it being overridden by an int (1 to 12) in this line /callmonth exch def ?
This provides me with retention of the loop counter for multiple uses, which would be consumed from the stack without this. I use it twice.
maybe the rest of the code and a description of what you are trying to achieve would be helpful from here. I'm guessing you're doing a 1 year calendar with each month spread over 2 A4 portrait pages - 24 pages total?
I haven't written multi-page PS programs before - are there '%' directives that are needed to make viewers/printers happy? evince just displays the last page of 24 with the simple header I gave your code :-/ ghostscript sees 24 pages though.
Yes, evince will run the whole thing without pause, while ghostscript will pause at each showpage. When I find suitable tutorial materials, and the time to study, I wish to learn about the various directives, usually prefaced with two percent symbols.
cheers, robin
Regards, Mark Trickett