Version: 1.2.94 (using KDE 3.1.94 (3.2 Beta 2), compiled sources) Compiler: gcc version 3.3.1 (SuSE Linux) OS: Linux (i686) release 2.4.21-144-default A print error occurred. Error message received from system: gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$out{/d2/dokumente/ASP/test**** Unable to open the initial device, quitting. 0test.pdf} -sPAPERSIZE=a4 -c .setpdfwrite -f '/tmp/kde-gassauer/kdeprint_1xFjwAxc' : execution failed with message: %2 may be this belongs to kprint ? cu ferdinand
Can you try it from another KDE application, please?
Subject: Re: kword printing to pdf crashes if filename contains a blank > ------- Can you try it from another KDE application, please? I could not reproduce this error with kspread nor with kedit, I guess it has something to to with the rename option if trying to print to the same file name it seems never to happen if this filename contains no blanks but all of this is very vague not very much help :-(
See also bug #71259 (not sure if it is a duplicate or not)
Looking again at this bug, I really think that it is a kdeprint problem. What I find curious is that the error message "**** Unable to open the initial device, quitting" seems to be in the middle of the file name but that the error is simply "%2". Have a nice day!
It happens when printing twice with the same file name containing a space. The first time, the user enters the filename and it works OK. The second time, the print dialog contains the already filled-in filename, but it's encoded and the space char is replaced by %20, which leads to an error when "gs" is invoked for the PDF conversion. The strange message in the middle of the command line simply comes from the fact that this message is generated using QString(...).args() construction, and that the string now contains the tag "%2" (the char '0' is ignored) which is replaced by the actual system error message. What happens is the following: QString("gs... -sOutputFile=...test%20test.pdf ...: %1").arg("*** Unable...") The error message is replaced at the garbage "%2" instead of the wanted "%1" tag.
*** Bug 71259 has been marked as a duplicate of this bug. ***
CVS commit by goffioul: Fix encoding error when updating output filename CCMAIL: 69725-done@bugs.kde.org M +9 -8 kprintdialog.cpp 1.77 --- kdelibs/kdeprint/kprintdialog.cpp #1.76:1.77 @@ -569,7 +569,7 @@ void KPrintDialog::initialize(KPrinter * // Initialize output filename if (!d->m_printer->outputFileName().isEmpty()) - d->m_file->lineEdit()->setText(d->m_printer->outputFileName()); + d->m_file->setURL( d->m_printer->outputFileName() ); else if (!d->m_printer->docFileName().isEmpty()) - d->m_file->lineEdit()->setText(d->m_printer->docDirectory()+"/"+d->m_printer->docFileName()+".ps"); + d->m_file->setURL( d->m_printer->docDirectory()+"/"+d->m_printer->docFileName()+".ps" ); if ( d->m_printers->count() > 0 ) @@ -661,5 +661,6 @@ void KPrintDialog::done(int result) if (!checkOutputFile()) return; d->m_printer->setOutputToFile(true); - d->m_printer->setOutputFileName(d->m_file->lineEdit()->text()); + /* be sure to decode the output filename */ + d->m_printer->setOutputFileName( KURL::decode_string( d->m_file->url() ) ); } else @@ -692,5 +693,5 @@ bool KPrintDialog::checkOutputFile() { bool value(false); - if (d->m_file->lineEdit()->text().isEmpty()) + if (d->m_file->url().isEmpty()) KMessageBox::error(this,i18n("The output filename is empty.")); else @@ -711,5 +712,5 @@ bool KPrintDialog::checkOutputFile() //value = (KMessageBox::warningYesNo(this,i18n("File \"%1\" already exists. Overwrite?").arg(f.absFilePath())) == KMessageBox::Yes); time_t mtimeDest = f.lastModified().toTime_t(); - KIO::RenameDlg dlg( this, i18n( "Print" ), QString::null, d->m_file->lineEdit()->text(), + KIO::RenameDlg dlg( this, i18n( "Print" ), QString::null, d->m_file->url(), KIO::M_OVERWRITE, ( time_t ) -1, f.size(), ( time_t ) -1, f.created().toTime_t() , mtimeDest+1, mtimeDest, true ); int result = dlg.exec(); @@ -725,5 +726,5 @@ bool KPrintDialog::checkOutputFile() case KIO::R_RENAME: url = dlg.newDestURL(); - d->m_file->lineEdit()->setText( url.path() ); + d->m_file->setURL( url.path() ); value = true; anotherCheck = true; @@ -786,5 +787,5 @@ void KPrintDialog::setOutputFileExtensio { url.setFileName( f.left( p ) + "." + ext ); - d->m_file->setURL( url.url() ); + d->m_file->setURL( KURL::decode_string( url.url() ) ); } } @@ -892,5 +893,5 @@ void KPrintDialog::slotHelp() void KPrintDialog::slotOutputFileSelected(const QString& txt) { - d->m_file->lineEdit()->setText(txt); + d->m_file->setURL( txt ); }
Closing old Resolved status bug.