Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2018/08/05)20180806 
rnissl Hi kens, PS forms work ;-)14:33.04 
kens Cool14:33.17 
rnissl just a minor implementation issue of execform14:33.36 
kens Remember, PDF forms are *not* preserved liek this, so if you round trip PS->PDF->PDF then you will get an explosion in size14:33.46 
rnissl if form dict is in global memory, /Implementation cannot be created by execform when setglobal is false14:34.25 
  execform fails with invalid access error14:34.50 
kens That's true, because you can't store a local object in global VM14:34.58 
rnissl the reference manual doesn't tell anything about how that case is to be implemented14:35.50 
  but /Implementation shall even be able to be created by execform when dict is already readonly14:36.31 
kens Hmmm14:36.43 
  readonly only prevents *PostScript* from writing to the dictionary, not the interpreter itself14:37.06 
rnissl so I think, execform should take care to adjust the allocation mode for /Implementation according to dict14:37.12 
kens But you still can't put a locally created object in a global VM object14:37.26 
  rnissl: No, its up to you to get the VM state correct.14:37.37 
  Why are you allocating the form dictionary in global VM anyway ?14:38.02 
rnissl yes, but it's execform which creates the local object to be put into /Implementation key14:38.02 
kens Yes, which means that you need to have the allocation mode correct at the time you execute execform14:38.29 
rnissl sure, in that way I got it working but it is less user friendly14:38.58 
kens Nobody ever accused PostScript of being user friendly14:39.15 
  And surely the user friendly approach is to allocate the form dictionary in local VM as well14:39.36 
  In general you should not mess with global VM14:39.44 
rnissl I played with findresource an it will either return a user or global object, depending on where it was created for example by defineresource14:40.13 
kens Well you got it working, so lets not worry about it :)14:40.56 
rnissl so one would first need to figure out the allocation mode of the dict, adjust setglobal, run execform and revert setglobal14:40.58 
kens I'm baffled as to why you have a form dictionary defined in global VM14:41.30 
rnissl I haven't read anything about having to so, so I guess, execform should take care of creating /Implementation accordingly14:42.45 
kens No, its generally up to you to get the VM allocation mode correct.14:43.15 
  execform isn't allowed to change the VM allocation mode14:43.28 
  That could lead to unexpected results.14:43.38 
rnissl why global VM: the form is defined on page 1 and reused on all following pages14:43.42 
kens How can I answer that ? I haven't seen your program14:45.28 
  But in general, Ghostscript's form handlign normally works, though its not commonly used in PostScript programs14:45.57 
rnissl this is the answer to your question, why I allocate the forms dict in global VM.14:46.18 
kens Then I didn't understand the answer14:46.40 
  You don't need to allocate the form dict in global VM just because you are using it on multiple pages14:46.57 
  Or you shouldn't have to, anyway14:47.16 
rnissl ok, I must admit, in this special case there is a save restore pair around my code.14:48.08 
kens Then you probably don't want to do that14:48.34 
rnissl so without global vm, my resource won't persist14:48.41 
kens You shoudl put the form definition outside the save and restore14:48.44 
  And if you don't, and define the form in global VM, then you must make sure teh VM allocation mode is global when executing the form14:49.13 
  In short; don't use global VM without a really good reason14:49.32 
  If you think you need to use VM then you probably need to rethink your program design14:49.55 
  There can be good reasons for using global VM of course, but they are unusual14:50.16 
rnissl and if PaintProc relies on beeing executed in local memory, I have to switch it back there and restore it before leaving PaintProc -- that's how I solved it14:50.28 
kens And if you do, then its up to you to make sure the allocation mode is correct throughout your program14:50.33 
rnissl ok, let's put it short -- I've found a working solution, although I find execform's behaviour inconvenient when used in combination with findresource14:54.13 
kens Well, as I say, that's really down to you using global VM, that has implications throughout the PostScript interpreter14:54.49 
rnissl thanks for your support kens, bye.14:55.44 
kens |NP bb14:55.54 
 Forward 1 day (to 2018/08/07)>>> 
ghostscript.com #mupdf
Search: