Execform and cache behavior
Hi,
I am writing an application that creates postscript files with embedded forms that are called by the execform operator.
I have two questions:
1- Is the form re-evaluated when I restore a previously saved graphic state?
I have read that the RIP reuse the form from the cache when the graphic state between invocations of the form is the same or that the changes are merely translations.
What happens if I do something like that:
Does the RIP recognize that the graphic state is the same for each invocation of the form? Is the behavior implementation dependent?
2-
The postscript documents are around 1000 pages each. There are some forms that need to be called on almost every page.
On the other hand, for every set of 20 consecutive pages I need to reuse the same graphic element around 50 times. The graphic element is costly to render so it would be nice to use execform. However as each graphic element is used only for 20 consecutive pages we would end up with 1000 / 20 = 50 forms when only one would be needed for each set.
- If I define a form with the same name each time I start a new set of 20 pages, does the RIP execute the newly defined form and replace the old cache with the new one? Is it implementation dependent?
- Is there a way to remove a form from the cache when I know it is not needed anymore?
Thanks
Hi,
I am writing an application that creates postscript files with embedded forms that are called by the execform operator.
I have two questions:
1- Is the form re-evaluated when I restore a previously saved graphic state?
I have read that the RIP reuse the form from the cache when the graphic state between invocations of the form is the same or that the changes are merely translations.
What happens if I do something like that:
Code:
/my-form ... def
...
/gstate-for-my-form gstate def
gstate-for-my-form currentgstate
...
many translations, rotations, scale etc
gsave
gstate-for-my-form setgstate
my-form execform
grestore
....
many translations, rotations, scale etc
gsave
gstate-for-my-form setgstate
my-form execform
grestore
....
Does the RIP recognize that the graphic state is the same for each invocation of the form? Is the behavior implementation dependent?
2-
The postscript documents are around 1000 pages each. There are some forms that need to be called on almost every page.
On the other hand, for every set of 20 consecutive pages I need to reuse the same graphic element around 50 times. The graphic element is costly to render so it would be nice to use execform. However as each graphic element is used only for 20 consecutive pages we would end up with 1000 / 20 = 50 forms when only one would be needed for each set.
- If I define a form with the same name each time I start a new set of 20 pages, does the RIP execute the newly defined form and replace the old cache with the new one? Is it implementation dependent?
- Is there a way to remove a form from the cache when I know it is not needed anymore?
Thanks