[bug-gs] Re: [gs-devel] Adding external postscript to pswrite
device |
Tobias Ödell
tobias.odell at jayway.net
Wed Jan 11 07:37:31 PST 2006
Hi,
This was strange...
Running the command below outputs a PS file that will print an error on the printed page on the printer but no error generated from GS:
c:\progra~1\gs\gs8.53\bin\gswin32c -q -dNOPAUSE -dSAFER -dBATCH -Ic:/progra~1/gs/gs8.53/bin;c:/progra~1/gs/gs8.53/lib -sDEVICE#ps2write -sOutputFile#ps2write2.ps PDF094734.pdf
When adding the -dDEBUG flag (sorry but the -dESTACKPRINT did not work) GS quits with an exit code 1 which contains the stacktrace. I think that is a bug itself ;-) However, I cannot figure out exactly what caused the error so I leave that to you experts. You should be aware that the same PDF file works great using the old pswrite device.
Attached you find a zip file containing 4 files.
PDF094734.pdf - The input file
ps2write_NOdebug.ps - The output file with NO debug flag enabled
ps2write_DEBUG.ps - The output file with debug flag enabled
debug.txt - The debug system out file
Thanks and regards,
/Tobias
On 2006-01-11 Ray Johnston wrote:
Tobias,
>
>The BnZr is an artificial mapping of 0x00 (NUL) into a name without
>nulls. I suspect that there is someplace where this name is handled
>without taking into account the additional 3 characters for every
>null in the original (probably Unicode) name when it creates a string
>for the 'cvs' operator. A 'rangecheck' will occur whenever the cvs
>cannot complete the conversion into the string (when the string is
>too short).
>
>Please send the output from -dESTACKPRINT to help us locate the
>area where the problem occurs as well as the input PS or PDF that
>you are trying to run through ps2ps2.
>
>At this point, since this looks like a bug, please send it to the
>bug-gs at ghostscript.com mailing list (don't forget the 'xefitra'
>keyword).
>
>Regards,
>Ray Johnston
>_____________________________________________________________________
>Tobias Ödell wrote:
>
>> Hi,
>>
>> I suspected this answer and it seems like I have to manipulate the PS file my self but that will affect the processing time since piping the generated PS file directly to samba was the fastest way of handling the printout process.
>>
>> However, does anyone know why I get the following error when using the ps2ps2 script. I really want to use that since that processed faster than the pswrite device. I get the same error when using the ps2write device directly. Is this tested?
>>
>> The command used:
>> c:\progra~1\gs\gs8.53\bin\gswin32c -q -dNOPAUSE -dSAFER -dBATCH -Ic:/progra~1/gs/gs8.53/bin;c:/progra~1/gs/gs8.53/lib -sDEVICE#ps2write -sOutputFile#ps2write.ps PDF094734.pdf
>>
>> The error:
>> -------------------------------
>> ERROR:
>> rangecheck
>> OFFENDING COMMAND:
>> cvs
>> STACK:
>>
>> /BnZrABnzr..........(and more)
>> true
>> --nostringval--
>> 12
>> -------------------------------
>>
>> Why is cvs an offending command?
>>
>> Thanks and regards,
>> /Tobias
>>
>> On 2006-01-10 Leonardo wrote:
>>
>> Hi Guys,
>>
>>>I guess you want to add Postscript to the printer job,
>>>but what Russell suggests actually adds to the PDF interpreter job.
>>>It won't pass through.
>>>Currently we don't implement a way
>>>for inserting user's Postscript code into ps2ps2 output.
>>>A workaround is to edit the PS file.
>>>
>>>Leo.
>>>
>>>
>>>----- Original Message -----
>>>From: "Tobias Ödell" <tobias.odell at jayway.net>
>>>To: <gs-devel at ghostscript.com>
>>>Cc: <gsview at ghostgum.com.au>
>>>Sent: Tuesday, January 10, 2006 4:22 PM
>>>Subject: Re: [gs-devel] Adding external postscript to pswrite device
>>>
>>>
>>>
>>>>Hi,
>>>>
>>>>It did not work when moving the -c parameter!
>>>>
>>>>I have tried the ps2ps2 script in 8.53 but when printing the generated
>>>>file I get the following error printed on the page. (No errors when
>>>>executing the script)
>>>>
>>>>-------------------------------
>>>>ERROR:
>>>>rangecheck
>>>>OFFENDING COMMAND:
>>>>cvs
>>>>STACK:
>>>>
>>>>/BnZrABnzr..........(and more)
>>>>true
>>>>--nostringval--
>>>>12
>>>>-------------------------------
>>>>
>>>>The command I used:
>>>>c:\progra~1\gs\gs8.53\lib\ps2ps2.bat PDF094734.pdf pswrite2.ps
>>>>
>>>>
>>>>
>>>>Since I cannot get this to work I cannot test the possibility to add extra
>>>>PS code.
>>>>
>>>>Have any idea?
>>>>
>>>>Thanks and regards,
>>>>/Tobias
>>>>
>>>>On 2006-01-05 Russell Lang wrote:
>>>>
>>>>Tobias,
>>>>
>>>>>>I'm wondering how it can be possible to add extra postscript
>>>>>>to the file that ghostscript generates with the device
>>>>>>pswrite. I want to add duplex, copies etc. functionality and
>>>>>>I tried to use the parameter -c but that does not work. No
>>>>>>extra postscript ends up in the generated ps file.
>>>>>>
>>>>>>It feels wrong that I have to open up the file afterwords and
>>>>>>add this code my self. Hopefully I missunderstood the -c
>>>>>>parameter and someone will clear this for me.
>>>>>>
>>>>>>The extra code I want to add is:
>>>>>>%%BeginSetup
>>>>>><< /Duplex false>> setpagedevice
>>>>>>%%EndSetup
>>>>>>
>>>>>>
>>>>>>The command I used:
>>>>>>c:\progra~1\gs\gs8.51\bin\gswin32c -dSAFER -dBATCH -dNOPAUSE -Ic:/progra~1/gs/gs8.51/bin;c:/progra~1/gs/gs8.51/lib
>>>>>> -sDEVICE#pswrite -sPAPERSIZE#a4 -r600 -c "<< /Duplex false >>
>>>>>>setpagedevice" -sOutputFile#pswrite.ps PDF094734.pdf
>>>>>
>>>>>Firstly, the -c command must be used after all other command line
>>>>>defines. In your command line, the preferred order would be:
>>>>> -sOutputFile#pswrite.ps -c "<< /Duplex false >> setpagedevice"
>>>>> -f PDF094734.pdf
>>>>>
>>>>>I would not expect pswrite to do what you want. Adding it afterwards
>>>>>is the best solution.
>>>>>
>>>>>There is a new ps2ps2 script which uses a new driver ps2write derived
>>>>
>>>>>from pdfwrite. This generates Level 2 PostScript. I doubt it will
>>>>
>>>>>allow you to automatically embed PS code, but it is worth testing in
>>>>>case it produces better PostScript.
>>>>>
>>>>>
>>>>
>>>>
>>>>_______________________________________________
>>>>gs-devel mailing list
>>>>gs-devel at ghostscript.com
>>>>http://www.ghostscript.com/mailman/listinfo/gs-devel
>>>>
>>>
>>>
>>
>>
>> _______________________________________________
>> gs-devel mailing list
>> gs-devel at ghostscript.com
>> http://www.ghostscript.com/mailman/listinfo/gs-devel
>>
>>
>
>
More information about the bug-gs
mailing list