[Info-vax] GS convert PDF to PS.

Mark Berryman mark at theberrymans.com
Tue Mar 15 11:36:25 EDT 2022


On 3/14/22 10:15 AM, Mark Berryman wrote:
> On 3/13/22 9:13 AM, Jan-Erik Söderholm wrote:
>> Hi.
>>
>> I'm new to Ghostscript.
>> I try to convert a PDF file to a PS file.
>>
>> And yes, this a step in the "print a PDF file" project.
>> I had some issues with getting the Xerox printer to print
>> a plain PDF file so I thought about converting i to to PS...
>>
>> Have tried with:
>>
>> $ gs "-dNOPAUSE" "-sDEVICE=ps2write" "-sOutputFile=out.ps" "-fOUT.PDF"
>>
>> The input file OUT.PDF only contains one page with 6-7 text lines
>> and one Code128 barcode. File created from the Python tool Reportlab.
>> And "out" refers to the Python step, it is the "input" file to GS.
>>
>> The PDf file opens fine on any other environment, also when put in
>> a VMS directory served by WASD.
>>
>> I have checked that the file org is as required by GS:
>>
>>   Record format:      Stream_LF, maximum 0 bytes, longest 16384 bytes
>>   Record attributes:  Carriage return carriage control
>>
>>
>> GS just hangs and consumes 100% cpu until I end it with ctrl-C.
>> Does it wait for some SYS$INPUT input? Any switch I'm missing?
>>
>> $ gs "-dNOPAUSE" "-sDEVICE=ps2write" "-sOutputFile=out.ps" "-fOUT.PDF"
>> GPL Ghostscript 9.55.0 (2021-09-27)
>> Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
>> This software is supplied under the GNU AGPLv3 and comes with NO 
>> WARRANTY:
>> see the file COPYING for details.
>> HV04JES_01 16:01:48 GS        CPU=00:04:01.95 PF=48109 IO=152495 MEM=1369
>> HV04JES_01 16:01:51 GS        CPU=00:04:04.56 PF=48109 IO=152496 MEM=1369
>> HV04JES_01 16:01:53 GS        CPU=00:04:06.37 PF=48109 IO=152497 MEM=1369
>>   Interrupt
>>
>> $
>>
>> One empty OUT.PS file is created and some empty TMPDIR files.
>>
>> _TEMP_T45404.;1       1/52        13-MAR-2022 16:01:45.84
>> _TEMP_U45404.;1       0/0         13-MAR-2022 16:01:45.85
>> _TEMP_V45404.;1       0/0         13-MAR-2022 16:01:45.85
>> _TEMP_W45404.;1       0/0         13-MAR-2022 16:01:45.85
>>
>> Any ideas? Some simple example for a GS command line to convert
>> a PDF file to a PS file?
> 
> You have found a bug.  There is an infinite loop in the code caused by a 
> member of a linked list pointing to itself.  Debugging now.
> 
> In the meantime, you might consider downloading XPDF from the VSI 
> products site (https://vmssoftware.com/products/list/).  It includes a 
> pdftops executable that may do what you want.
> 
> Alternatively, I have found there are a number of printers that cannot 
> print PDF files if simply sent to the raw port, or even via LPR, but 
> which can print them if the file is sent via IPP.  If you have Multinet, 
> try setting up an IPP queue to your printer.  If not, you can try my IPP 
> command-line utility.

The problem has been found and fixed.  A new kit has been posted.  The 
following is an example command that will convert a PDF file to postscript.

gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=ps2write -sOutputFile=xx.ps -f 
sys$login:v1000_specs.pdf

No quotes are needed in the command line because the images are built 
with the appropriate DECC feature logicals already set.

Mark Berryman





More information about the Info-vax mailing list