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

preferencesAboutTextFull
Clément Fauconnier 4 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 <frameworks/UBPlatformUtils.h>
#include <poppler/cpp/poppler-version.h>
#ifndef USE_XPDF
#include <poppler/cpp/poppler-version.h>
#endif
#include "core/memcheck.h"
@ -55,8 +57,11 @@ XPDFRenderer::XPDFRenderer(const QString &filename, bool importingFile)
#endif
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
#endif
sInstancesCount.ref();
}
@ -194,7 +199,11 @@ QImage* XPDFRenderer::createPDFImage(int pageNumber, qreal xscale, qreal yscale,
if(mSplash)
delete mSplash;
mSplash = new SplashOutputDev(splashModeRGB8, 1, false, paperColor);
#ifdef USE_XPDF
mSplash->startDoc(mDocument->getXRef());
#else
mSplash->startDoc(mDocument);
#endif
int rotation = 0; // in degrees (get it from the worldTransform if we want to support rotation)
bool useMediaBox = false;
bool crop = true;

@ -35,12 +35,19 @@
#include "globals/UBGlobals.h"
THIRD_PARTY_WARNINGS_DISABLE
#include <poppler/Object.h>
#include <poppler/GlobalParams.h>
#include <poppler/SplashOutputDev.h>
#include <poppler/PDFDoc.h>
THIRD_PARTY_WARNINGS_ENABLE
#ifdef USE_XPDF
THIRD_PARTY_WARNINGS_DISABLE
#include <xpdf/Object.h>
#include <xpdf/GlobalParams.h>
#include <xpdf/SplashOutputDev.h>
#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;

Loading…
Cancel
Save