rollback to xpdf on Windows (used USE_XPDF define, thanks to @ootwch PR)

preferencesAboutTextFull
Clément Fauconnier 5 years ago
parent 6edebf9632
commit a66b07f410
  1. 13
      src/pdf/XPDFRenderer.cpp
  2. 19
      src/pdf/XPDFRenderer.h

@ -32,7 +32,9 @@
#include <QtGui> #include <QtGui>
#include <frameworks/UBPlatformUtils.h> #include <frameworks/UBPlatformUtils.h>
#include <poppler/cpp/poppler-version.h> #ifndef USE_XPDF
#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;

@ -35,12 +35,19 @@
#include "globals/UBGlobals.h" #include "globals/UBGlobals.h"
THIRD_PARTY_WARNINGS_DISABLE #ifdef USE_XPDF
#include <poppler/Object.h> THIRD_PARTY_WARNINGS_DISABLE
#include <poppler/GlobalParams.h> #include <xpdf/Object.h>
#include <poppler/SplashOutputDev.h> #include <xpdf/GlobalParams.h>
#include <poppler/PDFDoc.h> #include <xpdf/SplashOutputDev.h>
THIRD_PARTY_WARNINGS_ENABLE #include <xpdf/PDFDoc.h>
THIRD_PARTY_WARNINGS_ENABLE
#else
#include <xpdf/Object.h>
#include <xpdf/GlobalParams.h>
#include <xpdf/SplashOutputDev.h>
#include <xpdf/PDFDoc.h>
#endif
class PDFDoc; class PDFDoc;

Loading…
Cancel
Save