Thread View: adobe.postscript.programming
2 messages
2 total messages
Started by norm_lee
Tue, 03 Feb 2004 00:21
Need Help: Encapsulating Acrobat Generated PS Files.
Author: norm_lee
Date: Tue, 03 Feb 2004 00:21
Date: Tue, 03 Feb 2004 00:21
33 lines
1782 bytes
1782 bytes
Hi, I was wondering is it possible to encapsulate the postscript code that is created by Adobe Acrobat when you save a PDF into PS format into a procedure?
For example when I write a few simple lines of code like:
x y moveto
(hello world) show
I can place the code in a procedure just by adding:
/my_procedure {x y moveto (hello world) show } def
When I try to wrap the PS generated code from Adobe Acrobat into a procedure I get the following error.
----- begin cut & paste -------------------------------
AFPL Ghostscript 7.03 (2001-10-20)
Copyright (C) 2001 artofcode LLC, Benicia, CA. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Displaying non DSC file C:/Temp/rl15.ps
Unrecoverable error: limitcheck in %ztokenexec_continue
Operand stack:
--nostringval-- my_procedure
--- Begin offending input ---
--- End offending input ---
file offset = 55296
gsapi_run_string_continue returns -13
----- end cut & paste -------------------------------
I am guessing the error is due to a the procedure violating a max length restriction. Is there any way to get around this?
Thanks Norm
Re: Need Help: Encapsulating Acrobat Generated PS Files.
Author: Aandi_Inston
Date: Tue, 03 Feb 2004 08:49
Date: Tue, 03 Feb 2004 08:49
23 lines
1738 bytes
1738 bytes
There are generally two reasons why encapsulating a piece of PostScript in this way will fail. 1. Length. The procedure has to fit in memory, of course - many printers have very limited memory, as little as 400K for everything. But also a procedure has to be built on the operand stack. That has a limit in size. And finally a procedure is an array, and arrays have a maximum size - typically no more than 64K, sometimes less. Only the memory can be increased, the array limit is architectural. 2. Inline data. Any image data is likely to appear inline, and that makes it impossible to wrap in a procedure (since the data has to be inline at the time the procedure is run, AFTER the call, not in the procedure). The general problem is a difficult one. Many people have tried to simply turn general chunks of PostScript into procedures, but found it impractical. If you have a level 3 printer with adequate memory, look into the ReusableStreamDecode filter instead. Aandi Inston
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