|
|
@ -32,7 +32,9 @@ |
|
|
|
#include <QtGui> |
|
|
|
#include <QtGui> |
|
|
|
|
|
|
|
|
|
|
|
#include <frameworks/UBPlatformUtils.h> |
|
|
|
#include <frameworks/UBPlatformUtils.h> |
|
|
|
|
|
|
|
#ifndef USE_XPDF |
|
|
|
#include <poppler/cpp/poppler-version.h> |
|
|
|
#include <poppler/cpp/poppler-version.h> |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#include "core/memcheck.h" |
|
|
|
#include "core/memcheck.h" |
|
|
|
|
|
|
|
|
|
|
@ -55,8 +57,11 @@ XPDFRenderer::XPDFRenderer(const QString &filename, bool importingFile) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
globalParams->setupBaseFonts(QFile::encodeName(UBPlatformUtils::applicationResourcesDirectory() + "/" + "fonts").data()); |
|
|
|
globalParams->setupBaseFonts(QFile::encodeName(UBPlatformUtils::applicationResourcesDirectory() + "/" + "fonts").data()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#ifdef USE_XPDF |
|
|
|
|
|
|
|
mDocument = new PDFDoc(new GString(filename.toLocal8Bit()), 0, 0, 0); // the filename GString is deleted on PDFDoc desctruction
|
|
|
|
|
|
|
|
#else |
|
|
|
mDocument = new PDFDoc(new GooString(filename.toLocal8Bit()), 0, 0, 0); // the filename GString is deleted on PDFDoc desctruction
|
|
|
|
mDocument = new PDFDoc(new GooString(filename.toLocal8Bit()), 0, 0, 0); // the filename GString is deleted on PDFDoc desctruction
|
|
|
|
|
|
|
|
#endif |
|
|
|
sInstancesCount.ref(); |
|
|
|
sInstancesCount.ref(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -194,7 +199,11 @@ QImage* XPDFRenderer::createPDFImage(int pageNumber, qreal xscale, qreal yscale, |
|
|
|
if(mSplash) |
|
|
|
if(mSplash) |
|
|
|
delete mSplash; |
|
|
|
delete mSplash; |
|
|
|
mSplash = new SplashOutputDev(splashModeRGB8, 1, false, paperColor); |
|
|
|
mSplash = new SplashOutputDev(splashModeRGB8, 1, false, paperColor); |
|
|
|
|
|
|
|
#ifdef USE_XPDF |
|
|
|
|
|
|
|
mSplash->startDoc(mDocument->getXRef()); |
|
|
|
|
|
|
|
#else |
|
|
|
mSplash->startDoc(mDocument); |
|
|
|
mSplash->startDoc(mDocument); |
|
|
|
|
|
|
|
#endif |
|
|
|
int rotation = 0; // in degrees (get it from the worldTransform if we want to support rotation)
|
|
|
|
int rotation = 0; // in degrees (get it from the worldTransform if we want to support rotation)
|
|
|
|
bool useMediaBox = false; |
|
|
|
bool useMediaBox = false; |
|
|
|
bool crop = true; |
|
|
|
bool crop = true; |
|
|
|