From a0cb74da47bdbbc790177da9bd054f8b5aa5d84c Mon Sep 17 00:00:00 2001
From: Niclas Bartsch <74824542+typingbeaver@users.noreply.github.com>
Date: Wed, 3 Jan 2024 17:06:38 +0100
Subject: [PATCH] Add `bestsecret_retoure`
---
README.md | 6 ++++++
index.html | 3 +++
src/js/labels.js | 27 +++++++++++++++++++++++++++
3 files changed, 36 insertions(+)
diff --git a/README.md b/README.md
index 90629d9..66ef826 100644
--- a/README.md
+++ b/README.md
@@ -104,6 +104,12 @@ International returns are most probably better on a real paper sheet/A5 Label.
+#### `bestsecret_retoure [dhl]`
+- **Size:** 62x150mm
+
+
+
+
#### `hm_retoure [dhl]`
- **Size:** 62x145mm
diff --git a/index.html b/index.html
index 3b6c6ad..1c5f967 100644
--- a/index.html
+++ b/index.html
@@ -96,6 +96,9 @@
+
diff --git a/src/js/labels.js b/src/js/labels.js
index 24732c3..f910aaa 100644
--- a/src/js/labels.js
+++ b/src/js/labels.js
@@ -11,6 +11,7 @@ export default function (labelType) {
case 'hermes-privat-v102': return hermesPrivatV102;
case 'adidas': return adidasRetoure;
case 'amazon-dhl': return amazonRetoureDhl;
+ case 'bestsecret-retoure-dhl': return bestsecretRetoureDhl;
case 'hm-retoure-dhl': return hmRetoureDhl;
case 'mediamarkt-saturn': return mediamarktSaturnRetoure;
case 'nike-dhl': return nikeRetoureDhl;
@@ -481,6 +482,32 @@ const amazonRetoureDhl = {
}
};
+const bestsecretRetoureDhl = {
+ file: {
+ type: 'pdf',
+ page: 3,
+ rotation: 90
+ },
+ width: 1701, // 144mm (=> 150mm)
+ crop(outputCanvas, ctx, image) {
+ ctx.drawImage(image, // Adresse
+ 372, 366, 1134, 814,
+ 0, 0, 970, 696);
+
+ ctx.beginPath(); ctx.moveTo(980, 0); ctx.lineTo(980, outputCanvas.height); ctx.stroke();
+
+ let barcodeSizeX = 670,
+ barcodeSizeY = 320;
+
+ ctx.drawImage(image, // Leitcode/Routingcode
+ 604, 1236, barcodeSizeX, barcodeSizeY,
+ 1020, 0, barcodeSizeX, barcodeSizeY);
+ ctx.drawImage(image, // Identcode/Sendungsnummer
+ 604, 1632, barcodeSizeX, barcodeSizeY,
+ 1020, 370, barcodeSizeX, barcodeSizeY);
+ }
+};
+
const hmRetoureDhl = {
file: {
type: 'pdf',