removed settings.ENFORCE_CHECK_EXTRACTABLE
parent
b686dd0139
commit
2e1be5721f
|
@ -9,7 +9,7 @@ from .pdftypes import dict_value
|
||||||
from .pdfparser import PDFParser
|
from .pdfparser import PDFParser
|
||||||
from .pdfdocument import PDFDocument
|
from .pdfdocument import PDFDocument
|
||||||
from .pdfdocument import PDFTextExtractionNotAllowed
|
from .pdfdocument import PDFTextExtractionNotAllowed
|
||||||
from .settings import ENFORCE_CHECK_EXTRACTABLE
|
from .settings import
|
||||||
|
|
||||||
import six # Python 2+3 compatibility
|
import six # Python 2+3 compatibility
|
||||||
|
|
||||||
|
@ -121,7 +121,6 @@ class PDFPage(object):
|
||||||
# Create a PDF document object that stores the document structure.
|
# Create a PDF document object that stores the document structure.
|
||||||
doc = PDFDocument(parser, password=password, caching=caching)
|
doc = PDFDocument(parser, password=password, caching=caching)
|
||||||
# Check if the document allows text extraction. If not, abort.
|
# Check if the document allows text extraction. If not, abort.
|
||||||
if ENFORCE_CHECK_EXTRACTABLE:
|
|
||||||
if check_extractable and not doc.is_extractable:
|
if check_extractable and not doc.is_extractable:
|
||||||
raise PDFTextExtractionNotAllowed('Text extraction is not allowed: %r' % fp)
|
raise PDFTextExtractionNotAllowed('Text extraction is not allowed: %r' % fp)
|
||||||
# Process each page contained in the document.
|
# Process each page contained in the document.
|
||||||
|
|
|
@ -6,4 +6,3 @@ except ImportError:
|
||||||
|
|
||||||
# Get defaults from django settings
|
# Get defaults from django settings
|
||||||
STRICT = getattr(django_settings, 'PDF_MINER_IS_STRICT', True)
|
STRICT = getattr(django_settings, 'PDF_MINER_IS_STRICT', True)
|
||||||
ENFORCE_CHECK_EXTRACTABLE = True
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import logging
|
||||||
import six
|
import six
|
||||||
import pdfminer.settings
|
import pdfminer.settings
|
||||||
pdfminer.settings.STRICT = False
|
pdfminer.settings.STRICT = False
|
||||||
pdfminer.settings.ENFORCE_CHECK_EXTRACTABLE = False
|
|
||||||
import pdfminer.high_level
|
import pdfminer.high_level
|
||||||
import pdfminer.layout
|
import pdfminer.layout
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue