mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-14 01:21:14 -06:00
Use the defined constant for A4 page size instead of creating it manually
This commit is contained in:
@@ -8,10 +8,10 @@ from django.conf import settings
|
|||||||
from django.utils.timezone import is_naive
|
from django.utils.timezone import is_naive
|
||||||
from django.utils.timezone import make_aware
|
from django.utils.timezone import make_aware
|
||||||
from gotenberg_client import GotenbergClient
|
from gotenberg_client import GotenbergClient
|
||||||
|
from gotenberg_client.constants import A4
|
||||||
from gotenberg_client.options import Measurement
|
from gotenberg_client.options import Measurement
|
||||||
from gotenberg_client.options import MeasurementUnitType
|
from gotenberg_client.options import MeasurementUnitType
|
||||||
from gotenberg_client.options import PageMarginsType
|
from gotenberg_client.options import PageMarginsType
|
||||||
from gotenberg_client.options import PageSize
|
|
||||||
from gotenberg_client.options import PdfAFormat
|
from gotenberg_client.options import PdfAFormat
|
||||||
from humanize import naturalsize
|
from humanize import naturalsize
|
||||||
from imap_tools import MailAttachment
|
from imap_tools import MailAttachment
|
||||||
@@ -376,7 +376,7 @@ class MailDocumentParser(DocumentParser):
|
|||||||
right=Measurement(0.1, MeasurementUnitType.Inches),
|
right=Measurement(0.1, MeasurementUnitType.Inches),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.size(PageSize(height=11.7, width=8.27))
|
.size(A4)
|
||||||
.scale(1.0)
|
.scale(1.0)
|
||||||
.run()
|
.run()
|
||||||
)
|
)
|
||||||
@@ -457,9 +457,7 @@ class MailDocumentParser(DocumentParser):
|
|||||||
left=Measurement(0.1, MeasurementUnitType.Inches),
|
left=Measurement(0.1, MeasurementUnitType.Inches),
|
||||||
right=Measurement(0.1, MeasurementUnitType.Inches),
|
right=Measurement(0.1, MeasurementUnitType.Inches),
|
||||||
),
|
),
|
||||||
).size(
|
).size(A4).scale(1.0)
|
||||||
PageSize(height=11.7, width=8.27),
|
|
||||||
).scale(1.0)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = route.run()
|
response = route.run()
|
||||||
|
|||||||
Reference in New Issue
Block a user