Lines 327-331
Link Here
|
327 |
poSplashOut = new SplashOutputDev(splashModeRGB8, 4, gFalse, sColor); |
327 |
poSplashOut = new SplashOutputDev(splashModeRGB8, 4, gFalse, sColor); |
328 |
PDFDoc* poDoc = poGDS->poDoc; |
328 |
PDFDoc* poDoc = poGDS->poDoc; |
|
|
329 |
#ifdef POPPLER_0_20_OR_LATER |
330 |
poSplashOut->startDoc(poDoc); |
331 |
#else |
329 |
poSplashOut->startDoc(poDoc->getXRef()); |
332 |
poSplashOut->startDoc(poDoc->getXRef()); |
|
|
333 |
#endif |
330 |
double dfDPI = poGDS->dfDPI; |
334 |
double dfDPI = poGDS->dfDPI; |
331 |
|
335 |
|
Lines 518-521
Link Here
|
518 |
|
522 |
|
519 |
#ifdef USE_POPPLER |
523 |
#ifdef USE_POPPLER |
|
|
524 |
#ifdef POPPLER_0_20_OR_LATER |
525 |
static void PDFDatasetErrorFunction(void* userData, ErrorCategory eErrCatagory, int nPos, char *pszMsg) |
526 |
{ |
527 |
CPLString osError; |
528 |
|
529 |
if (nPos >= 0) |
530 |
osError.Printf("Pos = %d, ", nPos); |
531 |
osError += pszMsg; |
532 |
|
533 |
if (strcmp(osError.c_str(), "Incorrect password") == 0) |
534 |
return; |
535 |
|
536 |
CPLError(CE_Failure, CPLE_AppDefined, "%s", osError.c_str()); |
537 |
} |
538 |
#else |
520 |
static void PDFDatasetErrorFunction(int nPos, char *pszMsg, va_list args) |
539 |
static void PDFDatasetErrorFunction(int nPos, char *pszMsg, va_list args) |
521 |
{ |
540 |
{ |
Lines 531-534
Link Here
|
531 |
CPLError(CE_Failure, CPLE_AppDefined, "%s", osError.c_str()); |
550 |
CPLError(CE_Failure, CPLE_AppDefined, "%s", osError.c_str()); |
532 |
} |
551 |
} |
|
|
552 |
#endif |
533 |
#endif |
553 |
#endif |
534 |
|
554 |
|
Lines 567-571
Link Here
|
567 |
|
587 |
|
568 |
/* Set custom error handler for poppler errors */ |
588 |
/* Set custom error handler for poppler errors */ |
|
|
589 |
#ifdef POPPLER_0_20_OR_LATER |
590 |
setErrorCallback(PDFDatasetErrorFunction, NULL); |
591 |
#else |
569 |
setErrorFunction(PDFDatasetErrorFunction); |
592 |
setErrorFunction(PDFDatasetErrorFunction); |
|
|
593 |
#endif |
570 |
|
594 |
|
571 |
/* poppler global variable */ |
595 |
/* poppler global variable */ |