mirror of
https://invent.kde.org/graphics/okular
synced 2024-07-05 00:58:46 +00:00
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
This commit is contained in:
parent
ca5b6e6203
commit
4554ddbf8b
|
@ -59,7 +59,7 @@ dviRenderer::dviRenderer()
|
|||
editorCommand(""),
|
||||
PostScriptOutPutString(0),
|
||||
PS_interface(new ghostscript_interface),
|
||||
_postscript(false),
|
||||
_postscript(true),
|
||||
line_boundary_encountered(false),
|
||||
word_boundary_encountered(false),
|
||||
current_page(0),
|
||||
|
|
|
@ -18,12 +18,12 @@
|
|||
#include <klocale.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <kprocess.h>
|
||||
#include <ktemporaryfile.h>
|
||||
#include <kurl.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QPainter>
|
||||
#include <QPixmap>
|
||||
#include <QTemporaryFile>
|
||||
#include <QTextStream>
|
||||
#include <QTimer>
|
||||
|
||||
|
@ -158,7 +158,9 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
|
|||
|
||||
// Generate a PNG-file
|
||||
// Step 1: Write the PostScriptString to a File
|
||||
QTemporaryFile PSfile;
|
||||
KTemporaryFile PSfile;
|
||||
PSfile.setAutoRemove(false);
|
||||
PSfile.setSuffix(".ps");
|
||||
PSfile.open();
|
||||
const QString PSfileName = PSfile.fileName();
|
||||
|
||||
|
@ -224,21 +226,20 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
|
|||
argus << "-dTextAlphaBits=4 -dGraphicsAlphaBits=2"; // Antialiasing
|
||||
argus << "-c" << "<< /PermitFileReading [ ExtraIncludePath ] /PermitFileWriting [] /PermitFileControl [] >> setuserparams .locksafe";
|
||||
argus << "-f" << PSfileName;
|
||||
|
||||
|
||||
#ifdef DEBUG_PSGS
|
||||
kDebug(kvs::dvi) << argus.join(" ");
|
||||
#endif
|
||||
|
||||
|
||||
proc << argus;
|
||||
proc.start();
|
||||
if (!proc.waitForStarted()) {
|
||||
int res = proc.execute();
|
||||
|
||||
if ( res ) {
|
||||
// Starting ghostscript did not work.
|
||||
// TODO: Issue error message, switch PS support off.
|
||||
kError(kvs::dvi) << "ghostview could not be started" << endl;
|
||||
} else {
|
||||
while(!proc.waitForFinished(10))
|
||||
qApp->processEvents();
|
||||
}
|
||||
}
|
||||
|
||||
PSfile.remove();
|
||||
|
||||
// Check if gs has indeed produced a file.
|
||||
|
|
Loading…
Reference in New Issue
Block a user