Commit 4554ddbf authored by Pino Toscano's avatar Pino Toscano

Patch by Luigi Toscano <luigi.toscano@tiscali.it> to reactivate the rendering...

Patch by Luigi Toscano <luigi.toscano@tiscali.it> to reactivate the rendering of postscript specials.
Thanks Luigi.
CCMAIL: luigi.toscano@tiscali.it

BUG: 154507

svn path=/trunk/KDE/kdegraphics/okular/; revision=754951
parent ca5b6e62
...@@ -59,7 +59,7 @@ dviRenderer::dviRenderer() ...@@ -59,7 +59,7 @@ dviRenderer::dviRenderer()
editorCommand(""), editorCommand(""),
PostScriptOutPutString(0), PostScriptOutPutString(0),
PS_interface(new ghostscript_interface), PS_interface(new ghostscript_interface),
_postscript(false), _postscript(true),
line_boundary_encountered(false), line_boundary_encountered(false),
word_boundary_encountered(false), word_boundary_encountered(false),
current_page(0), current_page(0),
......
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
#include <klocale.h> #include <klocale.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <kprocess.h> #include <kprocess.h>
#include <ktemporaryfile.h>
#include <kurl.h> #include <kurl.h>
#include <QDir> #include <QDir>
#include <QPainter> #include <QPainter>
#include <QPixmap> #include <QPixmap>
#include <QTemporaryFile>
#include <QTextStream> #include <QTextStream>
#include <QTimer> #include <QTimer>
...@@ -158,7 +158,9 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co ...@@ -158,7 +158,9 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
// Generate a PNG-file // Generate a PNG-file
// Step 1: Write the PostScriptString to a File // Step 1: Write the PostScriptString to a File
QTemporaryFile PSfile; KTemporaryFile PSfile;
PSfile.setAutoRemove(false);
PSfile.setSuffix(".ps");
PSfile.open(); PSfile.open();
const QString PSfileName = PSfile.fileName(); const QString PSfileName = PSfile.fileName();
...@@ -224,21 +226,20 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co ...@@ -224,21 +226,20 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
argus << "-dTextAlphaBits=4 -dGraphicsAlphaBits=2"; // Antialiasing argus << "-dTextAlphaBits=4 -dGraphicsAlphaBits=2"; // Antialiasing
argus << "-c" << "<< /PermitFileReading [ ExtraIncludePath ] /PermitFileWriting [] /PermitFileControl [] >> setuserparams .locksafe"; argus << "-c" << "<< /PermitFileReading [ ExtraIncludePath ] /PermitFileWriting [] /PermitFileControl [] >> setuserparams .locksafe";
argus << "-f" << PSfileName; argus << "-f" << PSfileName;
#ifdef DEBUG_PSGS #ifdef DEBUG_PSGS
kDebug(kvs::dvi) << argus.join(" "); kDebug(kvs::dvi) << argus.join(" ");
#endif #endif
proc << argus; proc << argus;
proc.start(); int res = proc.execute();
if (!proc.waitForStarted()) {
if ( res ) {
// Starting ghostscript did not work. // Starting ghostscript did not work.
// TODO: Issue error message, switch PS support off. // TODO: Issue error message, switch PS support off.
kError(kvs::dvi) << "ghostview could not be started" << endl; kError(kvs::dvi) << "ghostview could not be started" << endl;
} else { }
while(!proc.waitForFinished(10))
qApp->processEvents();
}
PSfile.remove(); PSfile.remove();
// Check if gs has indeed produced a file. // Check if gs has indeed produced a file.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment