mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Feature: Upgrade Gotenberg to v8 (#7094)
This commit is contained in:
@@ -102,7 +102,10 @@ class TikaDocumentParser(DocumentParser):
|
||||
}:
|
||||
route.pdf_format(PdfAFormat.A2b)
|
||||
elif settings.OCR_OUTPUT_TYPE == OutputTypeChoices.PDF_A1:
|
||||
route.pdf_format(PdfAFormat.A1a)
|
||||
self.log.warn(
|
||||
"Gotenberg does not support PDF/A-1a, choosing PDF/A-2b instead",
|
||||
)
|
||||
route.pdf_format(PdfAFormat.A2b)
|
||||
elif settings.OCR_OUTPUT_TYPE == OutputTypeChoices.PDF_A3:
|
||||
route.pdf_format(PdfAFormat.A3b)
|
||||
|
||||
|
@@ -109,7 +109,7 @@ class TestTikaParser(HttpxMockMixin, TestCase):
|
||||
for setting, expected_key in [
|
||||
("pdfa", "PDF/A-2b"),
|
||||
("pdfa-2", "PDF/A-2b"),
|
||||
("pdfa-1", "PDF/A-1a"),
|
||||
("pdfa-1", "PDF/A-2b"),
|
||||
("pdfa-3", "PDF/A-3b"),
|
||||
]:
|
||||
with override_settings(OCR_OUTPUT_TYPE=setting):
|
||||
@@ -124,9 +124,10 @@ class TestTikaParser(HttpxMockMixin, TestCase):
|
||||
request = self.httpx_mock.get_request()
|
||||
found = False
|
||||
for field in request.stream.fields:
|
||||
if isinstance(field, DataField) and field.name == "pdfFormat":
|
||||
if isinstance(field, DataField) and field.name == "pdfa":
|
||||
self.assertEqual(field.value, expected_key)
|
||||
found = True
|
||||
break
|
||||
self.assertTrue(found)
|
||||
|
||||
self.httpx_mock.reset(assert_all_responses_were_requested=False)
|
||||
|
Reference in New Issue
Block a user