Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

util_ghostscript.cpp File Reference

#include "util_ghostscript.h"
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QPainter>
#include <QPixmap>
#include <QProcess>
#include "scconfig.h"
#include "prefsfile.h"
#include "prefsmanager.h"
#include "scpaths.h"
#include "scribuscore.h"
#include "scribus.h"
#include "util.h"

Include dependency graph for util_ghostscript.cpp:

Go to the source code of this file.

Functions

int callGS (const QStringList &args_in, const QString device)
 Call GhostScript synchronously and store output.
int callGS (const QString &args_in, const QString device)
int convertPS2PS (QString in, QString out, const QStringList &opts, int level)
bool testGSAvailability (void)
bool testGSAvailability (const QString &gsPath)
bool testGSDeviceAvailability (const QString &device)
QString getGSVersion ()
 Return gs version. If gs couldn't be found or there was a problem parsing output, return false (in which case minor and major have undefined values).
bool getNumericGSVersion (int &major, int &minor)
bool getNumericGSVersion (const QString &ver, int &major, int &minor)
QString getGSDefaultExeName (void)
QMap< int, QString > SCRIBUS_API getGSExePaths (const QString &regKey)
QPixmap LoadPDF (QString fn, int Page, int Size, int *w, int *h)
 GS utility fucntions Moved functions written or modified by various people over the time from util.cpp.


Function Documentation

int callGS ( const QString &  args_in,
const QString  device 
)

int callGS ( const QStringList &  args_in,
const QString  device = "" 
)

Call GhostScript synchronously and store output.

The gs commands are all similar and consist of a few constant arguments, the variable arguments and the end arguments which are also invariant. It will always use -q -dNOPAUSE and will always end with -c showpage -c quit. It also does automatic device selection unless overridden, and uses the user's antialiasing preferences and font search path.

Shell metacharacters are not expanded - that includes quotes.

See also:
System .
Parameters:
args_in Custom arguments to GhostScript
device GS device to use (defaults to an image device if omitted)

Definition at line 51 of file util_ghostscript.cpp.

References PrefsManager::appPrefs, args, ScPaths::envPathSeparator, PrefsTable::get(), PrefsFile::getContext(), PrefsTable::getRowCount(), getShortPathName(), PrefsContext::getTable(), PrefsManager::ghostscriptExecutable(), ApplicationPrefs::gs_AntiAliasGraphics, ApplicationPrefs::gs_AntiAliasText, ScribusCore::havePNGAlpha(), PrefsManager::instance(), PrefsManager::prefsFile, ScCore, and System().

Referenced by ScImgDataLoader_PS::loadDCS1(), ScImgDataLoader_PS::loadDCS2(), LoadPDF(), ScImgDataLoader_PS::loadPhotoshop(), ScImgDataLoader_PS::loadPicture(), ScImgDataLoader_PDF::loadPicture(), BarcodeGenerator::paintBarcode(), ScImgDataLoader_PS::preloadAlphaChannel(), and ScImgDataLoader_PDF::preloadAlphaChannel().

int convertPS2PS ( QString  in,
QString  out,
const QStringList &  opts,
int  level 
)

QString getGSDefaultExeName ( void   ) 

QMap<int, QString> SCRIBUS_API getGSExePaths ( const QString &  regKey  ) 

QString getGSVersion (  ) 

Return gs version. If gs couldn't be found or there was a problem parsing output, return false (in which case minor and major have undefined values).

Return values:
QString version or false on error

Definition at line 203 of file util_ghostscript.cpp.

References args, getShortPathName(), and PrefsManager::instance().

Referenced by About::About(), and getNumericGSVersion().

bool getNumericGSVersion ( const QString &  ver,
int &  major,
int &  minor 
)

Definition at line 226 of file util_ghostscript.cpp.

bool getNumericGSVersion ( int &  major,
int &  minor 
)

QPixmap LoadPDF ( QString  fn,
int  Page,
int  Size,
int *  w,
int *  h 
)

GS utility fucntions Moved functions written or modified by various people over the time from util.cpp.

Author:
Craig Bradney

Definition at line 339 of file util_ghostscript.cpp.

References args, callGS(), ScPaths::getTempFileDir(), and p.

Referenced by Navigator::Navigator(), and Navigator::SetSeite().

bool testGSAvailability ( const QString &  gsPath  ) 

Definition at line 175 of file util_ghostscript.cpp.

References args, and getShortPathName().

bool testGSAvailability ( void   ) 

bool testGSDeviceAvailability ( const QString &  device  ) 

Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.