[gs-devel] code coverage of .ps files
Cheri Pompeo
CPompeo at uascwa.com
Tue Aug 7 09:49:52 PDT 2007
I'm trying to learn post script programming but still don't know much.
If I add the code you put below to any of the .ps files in the interpreter,
it executed correctly but causes some error ( I suspect some error code or
status) that makes my application think that the PDF file I'm trying to open
cannot be displayed.
In this case I was simply trying to write the .ps filename to an output file
(test.log) (a) file
Dup (gs_init.ps\n) writestring
closefile
test.log was created, the string gs_init.ps was written to the file each
time I started the application and the pdf file that would normally open
without error would not open. I will keep reading the ps manuals but if you
have an idea on how to solve this, please let me know.
Cheri
-----Original Message-----
From: 'Ralph Giles' [mailto:giles at ghostscript.com]
Sent: Friday, July 27, 2007 10:55 AM
To: Cheri Pompeo
Cc: 'gs-devel at ghostscript.com'; ray.johnston at artifex.com
Subject: Re: [gs-devel] code coverage of .ps files
On Fri, Jul 27, 2007 at 09:51:58AM -0700, Cheri Pompeo wrote:
> I don't mind hacking but I'm not sure how to print to a file from the .ps
> files. (assuming that is the best route to take)
This is something like:
(test.log) (a) file
dup (hello world!\n) writestring
closefile
> I'm thinking if I can somehow get the line number and filename of what
ever
> line on the .ps file I am using, I can go from there.
The problem is that the files are parsed into memory and then executed
later. You could perhaps modify the bind operator to wrap everything in
some code that logs the procedure name before executing it, and then
work backward from there.
For more accurate statistics, you'd have to augment the parser and
stacks to keep track of line number information. That's what I meant
about not keeping much debugging information. It's not a small job,
but not impossible either.
Maybe Ray has some ideas.
-r
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ghostscript.com/pipermail/gs-devel/attachments/20070807/3b1b7fd3/attachment-0001.htm
More information about the gs-devel
mailing list