Skip to content

Commit

Permalink
Add bestsecret_retoure
Browse files Browse the repository at this point in the history
  • Loading branch information
typingbeaver committed Jan 3, 2024
1 parent 562264f commit a0cb74d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ International returns are most probably better on a real paper sheet/A5 Label.
<!-- ![Sample Image]() -->
<!-- [Sample PDF]() -->

#### `bestsecret_retoure [dhl]`
- **Size:** 62x150mm

<!-- ![Sample Image]() -->
<!-- [Sample PDF]() -->

#### `hm_retoure [dhl]`
- **Size:** 62x145mm

Expand Down
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
<option value="amazon-dhl">
amazon_retoure [dhl] [gif] | 62x120mm
</option>
<option value="bestsecret-retoure-dhl">
bestsecret_retoure [dhl] | 62x150mm
</option>
<option value="hm-retoure-dhl">
hm_retoure [dhl] | 62x150mm
</option>
Expand Down
27 changes: 27 additions & 0 deletions src/js/labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit a0cb74d

Please sign in to comment.