Version: 0.20 KDE 3.1.90 (using KDE Devel) Installed from: Compiled sources Compiler: gcc 2.95.3 OS: Linux If I try to open any file using kghostview, it will fail to open the file. I am using gs 7.00 and if i call gs on the file on the commandline everything is fine. kghostview displays the following output and then a requester "failed to open..." thst@server:~ > kghostview rechnung1.pdf kio (KDirWatch): Available methods: Stat, DNotify kghostview (kdegraphics): KGVConfigDialog::readSettings kghostview (kdegraphics): KPSWidget::stopInterpreter() kghostview (kdegraphics): KPSWidget::stopInterpreter() kghostview (kdegraphics): DisplayOptions::setMagnification(1) kghostview (kdegraphics): DisplayOptions::setMagnification(1): nearest allowed magnification: 1 kparts: MainWindow::createGUI, part=0x80e4a28 KGVPart kgvpart kghostview (kdegraphics): KPSWidget::stopInterpreter() kghostview (kdegraphics): DisplayOptions::setMagnification(1) kghostview (kdegraphics): DisplayOptions::setMagnification(1): nearest allowed magnification: 1 kghostview (kdegraphics): DisplayOptions::setMagnification(1) kghostview (kdegraphics): DisplayOptions::setMagnification(1): nearest allowed magnification: 1 kio (KSycoca): Trying to open ksycoca from /var/tmp/kdecache-thst/ksycoca kghostview (kdegraphics): KGVRun::foundMimeType( application/pdf ) kghostview (kdegraphics): KGVPart::slotMimetype: type=application/pdf kghostview (kdegraphics): KGVDocument::openFile kghostview (kdegraphics): Pdf2dsc: started Error: /undefined in .locksafe Operand stack: Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- Dictionary stack: --dict:1007/1123(ro)(G)-- --dict:0/20(G)-- --dict:66/200(L)-- Current allocation mode is local Last OS error: 2 AFPL Ghostscript 7.00: Unrecoverable error, exit code 1 kghostview (kdegraphics): Pdf2dsc: process exited kghostview (kdegraphics): KGVDocument::openPDFFileContinue
I can confirm this. The problem is on doing the PDF->DSC convertion, which runs the following command: gs "-dSAFER" "-dPARANOIDSAFER" "-dDELAYSAFER" "-dNODISPLAY" "-dQUIET" "-sPDFname=rechnung.pdf" "-sDSCname=rechnung.dsc" "-c" "<< /PermitFileReading [ PDFname ] /PermitFileWriting [ DSCname ] /PermitFileControl [] >> setuserparams .locksafe" "-f" "pdf2dsc.ps" "-c" "quit" On my system, it works on GNU gs 7.05 and it fails on GNU gs 6.52. The reporter is using AFPL gs which is a previous version to gnu-gs 7.05. I am CCing Waldo since this is his code and I think he would be better prepared to answer questions about this.
Seems like this version of GS doesn't know .locksafe Does it work if you copy the version of .locksafe inside gs_init.ps from your 7.0.5 version to 6.52 ?
Subject: Re: KGhostview fails to display ps or pdf files (error while opening) Le Mercredi 16 Avril 2003 10:41, Waldo Bastian a
I got confirmation that .locksafe has been introduced in 6.53 (for 6.x) resp 7.04 (for 7.x) So if you are using AFPL gs 7.00 I recommend that you upgrade to at least AFPL gs 7.04. See http://www.ghostscript.com/article/23.html
I installed gs 7.04 and kgv works again. Since Kghostview doesnt work at all if an older version of gs is installed, there should be a test in the programm code and in the configure script, telling the user to upgrade or use at own risk. So this could be converted into a feature-request :-) and works for me. Thanks!
Works for me
Yes, there should indeed be a test. I was under the mistaken assumption that .locksafe would be available on most versions :-(
Subject: Re: KGhostview fails to display ps or pdf files (error while opening) We already test for the version of gs to do some things. If Waldo or someone else can find the correct parameters for older gs's, I will put this in the version detection code as well. I do know kghostview's code but my knowledge of the postscript language is limited (understament), so I can't help there. Still, I think this is a bug. We cannot just require users to upgrade ghostscript unless we conclude that is the only option. ghostscript is not just a program to display postscript files, but it is the base of the whole unix printing system and it is not really backward and foward compatible. Often you upgrade ghostscript and you must upgrade your whole printing system as well or at least change the whole settings. This is pretty messy. Is it really impossible to implement something like this in gs 6.52? Can't we adapt the postscript code from .locksafe in gnu gs 7? How about falling back to -dSAFER without the paranoia setting? I really don't like the idea of rendering kghostview unusable on a lot of systems. I can't really help here, I know almost nothing about postscript. I am tempted to reopen, but I will wait for Waldo's point of view. Even if a solution is not immediatelly obvious, I think we should reopen. In fact, if a solution is immediatelly obvious, we should fix it right now and leave it closed ;-) Regards, luis pedro
I just compiled and installed kde3.1.1a. After this kghostview will no longer display any postscript files. Concerning pdf files it quits with a can not open file error. However, the same files display fine in ghostview/acroread. Is this related to the gs version I use. If so, would it not be a good idea to mark in the announcement that the supported versions of ghostscript have changed?? Kind regards.
There are two bugs with version 3.1.1a: one is that it doesn't really work - shows only one page or nothing - in some instalations of gs and is solved for 3.1.2 which is coming very soon (this is probably what you are seeing). The warning you are talking about - we do not support real old versions anymore, true - will be in version 3.2 (we are careful about changing user-visible messages in stable versions not to break translations). If you are working from source you might check http://bugs.kde.org/show_bug.cgi?id=57441 for a patch for the first bug. HTH,