Lines 348-354
Link Here
|
348 |
SplashOutputDev *poSplashOut; |
348 |
SplashOutputDev *poSplashOut; |
349 |
poSplashOut = new SplashOutputDev(splashModeRGB8, 4, gFalse, sColor); |
349 |
poSplashOut = new SplashOutputDev(splashModeRGB8, 4, gFalse, sColor); |
350 |
PDFDoc* poDoc = poGDS->poDoc; |
350 |
PDFDoc* poDoc = poGDS->poDoc; |
|
|
351 |
#ifdef POPPLER_0_20_OR_LATER |
352 |
poSplashOut->startDoc(poDoc); |
353 |
#else |
351 |
poSplashOut->startDoc(poDoc->getXRef()); |
354 |
poSplashOut->startDoc(poDoc->getXRef()); |
|
|
355 |
#endif |
352 |
double dfDPI = poGDS->dfDPI; |
356 |
double dfDPI = poGDS->dfDPI; |
353 |
|
357 |
|
354 |
/* EVIL: we modify a private member... */ |
358 |
/* EVIL: we modify a private member... */ |
Lines 489-494
Link Here
|
489 |
/* PDFDatasetErrorFunction() */ |
493 |
/* PDFDatasetErrorFunction() */ |
490 |
/************************************************************************/ |
494 |
/************************************************************************/ |
491 |
|
495 |
|
|
|
496 |
#ifdef POPPLER_0_20_OR_LATER |
497 |
static void PDFDatasetErrorFunction(void* userData, ErrorCategory eErrCatagory, int nPos, char *pszMsg) |
498 |
{ |
499 |
CPLString osError; |
500 |
|
501 |
if (nPos >= 0) |
502 |
osError.Printf("Pos = %d, ", nPos); |
503 |
osError += pszMsg; |
504 |
|
505 |
if (strcmp(osError.c_str(), "Incorrect password") == 0) |
506 |
return; |
507 |
|
508 |
CPLError(CE_Failure, CPLE_AppDefined, "%s", osError.c_str()); |
509 |
} |
510 |
#else |
492 |
static void PDFDatasetErrorFunction(int nPos, char *pszMsg, va_list args) |
511 |
static void PDFDatasetErrorFunction(int nPos, char *pszMsg, va_list args) |
493 |
{ |
512 |
{ |
494 |
CPLString osError; |
513 |
CPLString osError; |
Lines 502-507
Link Here
|
502 |
|
521 |
|
503 |
CPLError(CE_Failure, CPLE_AppDefined, "%s", osError.c_str()); |
522 |
CPLError(CE_Failure, CPLE_AppDefined, "%s", osError.c_str()); |
504 |
} |
523 |
} |
|
|
524 |
#endif |
505 |
|
525 |
|
506 |
/************************************************************************/ |
526 |
/************************************************************************/ |
507 |
/* Open() */ |
527 |
/* Open() */ |
Lines 536-542
Link Here
|
536 |
GooString* poUserPwd = NULL; |
556 |
GooString* poUserPwd = NULL; |
537 |
|
557 |
|
538 |
/* Set custom error handler for poppler errors */ |
558 |
/* Set custom error handler for poppler errors */ |
|
|
559 |
#ifdef POPPLER_0_20_OR_LATER |
560 |
setErrorCallback(PDFDatasetErrorFunction, NULL); |
561 |
#else |
539 |
setErrorFunction(PDFDatasetErrorFunction); |
562 |
setErrorFunction(PDFDatasetErrorFunction); |
|
|
563 |
#endif |
540 |
|
564 |
|
541 |
PDFDoc* poDoc = NULL; |
565 |
PDFDoc* poDoc = NULL; |
542 |
ObjectAutoFree oObj; |
566 |
ObjectAutoFree oObj; |