util_ghostscript.h File Reference
#include <QMap>#include <QPixmap>#include <QString>#include <QStringList>#include "scribusapi.h"


Go to the source code of this file.
Functions | |
| QPixmap SCRIBUS_API | 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. | |
| int SCRIBUS_API | callGS (const QStringList &args_in, const QString device="") |
| Call GhostScript synchronously and store output. | |
| int SCRIBUS_API | callGS (const QString &args_in, const QString device="") |
| int SCRIBUS_API | convertPS2PS (QString in, QString out, const QStringList &opts, int level) |
| bool SCRIBUS_API | testGSAvailability (void) |
| bool SCRIBUS_API | testGSAvailability (const QString &gsPath) |
| bool SCRIBUS_API | testGSDeviceAvailability (const QString &device) |
| QString SCRIBUS_API | 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 SCRIBUS_API | getNumericGSVersion (int &major, int &minor) |
| bool SCRIBUS_API | getNumericGSVersion (const QString &ver, int &major, int &minor) |
| QString SCRIBUS_API | getGSDefaultExeName (void) |
| QMap< int, QString > SCRIBUS_API | getGSExePaths (const QString ®Key) |
Function Documentation
| int SCRIBUS_API callGS | ( | const QString & | args_in, | |
| const QString | device = "" | |||
| ) |
Definition at line 92 of file util_ghostscript.cpp.
References PrefsManager::appPrefs, PrefsTable::get(), PrefsFile::getContext(), PrefsTable::getRowCount(), getShortPathName(), PrefsContext::getTable(), PrefsManager::ghostscriptExecutable(), ApplicationPrefs::gs_AntiAliasGraphics, ApplicationPrefs::gs_AntiAliasText, ScribusCore::havePNGAlpha(), PrefsManager::instance(), PrefsManager::prefsFile, and ScCore.
| int SCRIBUS_API 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 SCRIBUS_API convertPS2PS | ( | QString | in, | |
| QString | out, | |||
| const QStringList & | opts, | |||
| int | level | |||
| ) |
Definition at line 131 of file util_ghostscript.cpp.
References args, getNumericGSVersion(), getShortPathName(), PrefsManager::ghostscriptExecutable(), PrefsManager::instance(), and System().
Referenced by ScPrintEngine_PS::print(), Printer_print(), and ScPrintEngine_GDI::printPage_PS().
| QString SCRIBUS_API getGSDefaultExeName | ( | void | ) |
Definition at line 240 of file util_ghostscript.cpp.
References getGSExePaths().
Referenced by PrefsManager::initDefaults(), and TabExternalToolsWidget::rescanForTools().
| QMap<int, QString> SCRIBUS_API getGSExePaths | ( | const QString & | regKey | ) |
Definition at line 277 of file util_ghostscript.cpp.
References getNumericGSVersion(), PrefsManager::ghostscriptExecutable(), and PrefsManager::instance().
Referenced by getGSDefaultExeName().
| QString SCRIBUS_API 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 SCRIBUS_API getNumericGSVersion | ( | const QString & | ver, | |
| int & | major, | |||
| int & | minor | |||
| ) |
Definition at line 226 of file util_ghostscript.cpp.
| bool SCRIBUS_API getNumericGSVersion | ( | int & | major, | |
| int & | minor | |||
| ) |
Definition at line 220 of file util_ghostscript.cpp.
References getGSVersion(), and getNumericGSVersion().
Referenced by convertPS2PS(), getGSExePaths(), getNumericGSVersion(), ScImgDataLoader_PS::loadPhotoshop(), and PPreview::PPreview().
| QPixmap SCRIBUS_API 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.
Definition at line 339 of file util_ghostscript.cpp.
References args, callGS(), ScPaths::getTempFileDir(), and p.
Referenced by Navigator::Navigator(), and Navigator::SetSeite().
| bool SCRIBUS_API testGSAvailability | ( | const QString & | gsPath | ) |
| bool SCRIBUS_API testGSAvailability | ( | void | ) |
Definition at line 168 of file util_ghostscript.cpp.
References args, PrefsManager::ghostscriptExecutable(), PrefsManager::instance(), and testGSAvailability().
Referenced by ScribusCore::initScribusCore(), PrefsManager::ReadPref(), ScribusCore::recheckGS(), and testGSAvailability().
| bool SCRIBUS_API testGSDeviceAvailability | ( | const QString & | device | ) |
Definition at line 187 of file util_ghostscript.cpp.
References args, getShortPathName(), PrefsManager::ghostscriptExecutable(), and PrefsManager::instance().
Referenced by ScribusCore::initScribusCore(), and ScribusCore::recheckGS().
