Skip to content

Commit 23c51dd

Browse files
jans23sudhir-erpharbor
authored andcommitted
label format 6x4"
1 parent 300ef5f commit 23c51dd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

delivery_ups_oca/models/delivery_carrier.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def ups_send_shipping(self, pickings):
162162
return [self.ups_create_shipping(p) for p in pickings]
163163

164164
def _convert_gif_to_pdf(self, gif_data):
165-
"""Convert GIF image data to PDF format
165+
"""Convert GIF image data to PDF format with proper 6x4" page size
166166
:param gif_data: base64 encoded GIF data
167167
:returns: base64 encoded PDF data
168168
"""
@@ -171,7 +171,8 @@ def _convert_gif_to_pdf(self, gif_data):
171171
image_string = io.BytesIO(img_decoded)
172172
im = Image.open(image_string)
173173
label_result = io.BytesIO()
174-
im.save(label_result, 'PDF')
174+
# Set resolution to 236 DPI (standard for 6x4" UPS labels)
175+
im.save(label_result, 'PDF', resolution=236.0)
175176
return base64.b64encode(label_result.getvalue()).decode('utf-8')
176177

177178
def _prepare_ups_label_attachment(self, picking, values):

0 commit comments

Comments
 (0)