Changed logic in sticker pdf service #1266
@@ -626,7 +626,11 @@ class StickerPdfService
|
||||
$width = (float) $structure->sticker_width;
|
||||
$height = (float) $structure->sticker_height;
|
||||
|
||||
$pdf = new TCPDF('P', 'mm', [$width, $height], true, 'UTF-8', false);
|
||||
$orientation = $width > $height ? 'L' : 'P';
|
||||
|
||||
$pdf = new TCPDF($orientation, 'mm', [$width, $height], true, 'UTF-8', false);
|
||||
|
||||
// $pdf = new TCPDF('P', 'mm', ['width','height'], true, 'UTF-8', false);
|
||||
|
||||
$pdf->setPrintHeader(false);
|
||||
$pdf->setPrintFooter(false);
|
||||
@@ -1478,17 +1482,21 @@ class StickerPdfService
|
||||
// +
|
||||
// ($gap * ($count - 1));
|
||||
|
||||
$pdf = new TCPDF(
|
||||
'P',
|
||||
'mm',
|
||||
[
|
||||
$stickerWidth,
|
||||
$stickerHeight
|
||||
],
|
||||
true,
|
||||
'UTF-8',
|
||||
false
|
||||
);
|
||||
$orientation = $stickerWidth > $stickerHeight ? 'L' : 'P';
|
||||
|
||||
// $pdf = new TCPDF(
|
||||
// 'P',
|
||||
// 'mm',
|
||||
// [
|
||||
// $stickerWidth,
|
||||
// $stickerHeight
|
||||
// ],
|
||||
// true,
|
||||
// 'UTF-8',
|
||||
// false
|
||||
// );
|
||||
|
||||
$pdf = new TCPDF($orientation, 'mm', [$stickerWidth, $stickerHeight], true, 'UTF-8', false);
|
||||
|
||||
$pdf->setPrintHeader(false);
|
||||
$pdf->setPrintFooter(false);
|
||||
|
||||
Reference in New Issue
Block a user