Subject: pkg/12365: printing PDF files from ghostview (pkgsrc/print/gv) fails
To: None <gnats-bugs@gnats.netbsd.org>
From: Brook Milligan <brook@biology.nmsu.edu>
List: netbsd-bugs
Date: 03/09/2001 07:59:09
>Number:         12365
>Category:       pkg
>Synopsis:       printing PDF files from ghostview (pkgsrc/print/gv) fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 09 07:00:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Brook Milligan
>Release:        NetBSD-1.5
>Organization:
Brook G. Milligan                      Internet:  brook@nmsu.edu
Department of Biology
New Mexico State University            Telephone:  (505) 646-7980
Las Cruces, New Mexico  88003  U.S.A.  FAX:        (505) 646-5665
>Environment:
	
System: NetBSD biology.nmsu.edu 1.4 NetBSD 1.4 (BIOLOGY) #0: Tue Nov 23 11:51:18 MST 1999 root@biology.nmsu.edu:/usr/src/sys/arch/i386/compile/BIOLOGY i386

>Description:
Ghostview fails to print PDF files because the ghostscript command
that is run to convert PDF to postscript in preparation for printing
fails.  This command is dictated by the GV.gsCmdConvPDF X resource.
The original definition is:

	gs -dNODISPLAY -dQUIET -dNOPAUSE -sPSFile=%s %s -c quit

where the two %s are replaced by the output (*.ps) and input (*.pdf)
files, respectively.  As far as I can tell, this command does not
actually generate any file, even when run manually.  A command that
will work is:

	gs -dQUIET -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=%s %s

This portion of the X resources file is generated from the Imakefile.
The fix is to modify Imakefile so that the correct command is created.
	
>How-To-Repeat:
Try to print a PDF file using ghostview.

>Fix:

Apply following patch.

--- source/Imakefile.orig	Fri Mar  9 00:15:42 2001
+++ source/Imakefile	Fri Mar  9 00:16:45 2001
@@ -312,7 +312,7 @@
 	@echo ""							>> $(GV_INTERN_RES_DAT)
 	@echo "GV.gsInterpreter:	gs" >> $(GV_INTERN_RES_DAT)
 	@echo "GV.gsCmdScanPDF:	gs -dNODISPLAY -dQUIET -sPDFname=%s -sDSCname=%s pdf2dsc.ps -c quit" >> $(GV_INTERN_RES_DAT)
-	@echo "GV.gsCmdConvPDF:	gs -dNODISPLAY -dQUIET $(PS_LEVEL) -dNOPAUSE -sPSFile=%s %s -c quit" >> $(GV_INTERN_RES_DAT)
+	@echo "GV.gsCmdConvPDF:	gs -dQUIET $(PS_LEVEL) -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=%s %s" >> $(GV_INTERN_RES_DAT)
 	@echo "GV.gsX11Device:		-sDEVICE=x11" >> $(GV_INTERN_RES_DAT)
 	@echo "GV.gsX11AlphaDevice:	-dNOPLATFONTS -sDEVICE=x11alpha" >> $(GV_INTERN_RES_DAT)
 	@echo "GV.gsSafer:		True" >> $(GV_INTERN_RES_DAT)
>Release-Note:
>Audit-Trail:
>Unformatted: