Summary: | Parameters are not being sent to device driver via setpagedevice in git version | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Leonid Lukomskij <leonidas> |
Component: | Client API | Assignee: | Ray Johnston <ray.johnston> |
Status: | NOTIFIED WORKSFORME | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | master | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Customer: | 582 | Word Size: | --- |
Attachments: |
my get_params and put params
put_params.c |
Description
Leonid Lukomskij
2011-10-14 16:58:53 UTC
Please attach your custom 'get_params' and 'put_params'. Without this we can't help. Created attachment 8010 [details]
my get_params and put params
This code worked with previous versions of gs, but doesn't work with git
Created attachment 8011 [details]
put_params.c
I don't see any obvious reason why "Thinning" shouldn't make it through to as
a custom parameter. However, 'put_params' is not supposed to change the device
unless ALL of the setting is successful (per the setpagedevice spec), so I
recommend changing your put_params to something like the attached. This only
sets the parameter AFTER the call to gdev_prn_put_params succeeds.
So I made what you suggest. But I still have problems. On second call of my put_params gdev_prn_put_params (this is first call in my function now) returns -21. As the result interpretation stops with error Unrecoverable error: undefined in .putdeviceprops What does this mean? So I made what you suggest. But I still have problems. On second call of my put_params gdev_prn_put_params (this is first call in my function now) returns -21. As the result interpretation stops with error Unrecoverable error: undefined in .putdeviceprops What does this mean? I'll have a look into this. Keeping it as a 'bug' for now. Please re-run the -21 (undefined) error with: -dSETPDDEBUG -dOSTACKPRINT -dESTACKPRINT and attach the log. I added these parameters to the GS DLL call, but I don't have any additional output in log. Can problem be that I don't use command line but use gs dll as is? The problem may be that your application isn't collecting the stdout. Do you have a call to gsapi_set_stdio ??? If so, do your functions write the data to a file that you can capture ??? See the usage examples in psi/dwmainc.c We can't do much without the requested information from stdout and stderr. My applications collects stdout, but it doesn't contain any output. Actually I found place where error -21 is. This is function ref_param_read_commit. It seems it requires all parameters to be read. But my (custom) parameters was not read => error. So I have impression that it's incorrect to call gdev_prn_put_params before custom params reading. So we are in the very beginning As I described in comment #3, you collect your additional parameters BEFORE calling gdev_prn_put_params, but NOT apply the changes in case the call to gdev_prn_put_params encounters an error. Only after gdev_prn_put_params returns >=0 should you change the values that actually affect your custom device. Until then the values should be kept in temporary variables in your put_params function. So I actually do this, but I never get my parameter, I get 0 in any cases. There must be an error in your invocation of the <</MyParam 1>> setpagedevice Note that parameters are case sensitive. Until you can get the output from -dSETPDDEBUG there is nothing we can do. No new information, so closing as WORKSFORME. Please re-open if you get the log files. |