Skip to content

Commit 56e44be

Browse files
committed
ACP2E-1216: Large area customizable option not able to render for print invoice PDF
1 parent 6dbb7fc commit 56e44be

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public function draw()
209209
$lines[][] = ['text' => $text, 'feed' => $leftBound + 5];
210210
}
211211

212-
$drawItems[] = ['lines' => $lines, 'height' => 15];
212+
$drawItems[] = ['lines' => $lines, 'height' => 15, 'shift' => 5];
213213
}
214214
}
215215

app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,17 +239,18 @@ private function drawCustomOptions(array $draw): array
239239
if ($option['value']) {
240240
$text = [];
241241
$printValue = $option['print_value'] ?? $this->filterManager->stripTags($option['value']);
242+
$printValue = str_replace(PHP_EOL, ', ', $printValue);
242243
$values = explode(', ', $printValue);
243244
foreach ($values as $value) {
244-
foreach ($this->string->split($value, 30, true, true) as $subValue) {
245+
foreach ($this->string->split($value, 50, true, true) as $subValue) {
245246
$text[] = $subValue;
246247
}
247248
}
248249

249250
$lines[][] = ['text' => $text, 'feed' => 40];
250251
}
251252

252-
$draw[] = ['lines' => $lines, 'height' => 15];
253+
$draw[] = ['lines' => $lines, 'height' => 15, 'shift' => 5];
253254
}
254255
}
255256

app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function draw()
185185
$lines[][] = ['text' => $text, 'feed' => 65];
186186
}
187187

188-
$drawItems[] = ['lines' => $lines, 'height' => 15];
188+
$drawItems[] = ['lines' => $lines, 'height' => 15, 'shift' => 5];
189189
}
190190
}
191191

app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,8 +1108,9 @@ private function correctText($column, $height, $font, $page) :int
11081108
$lineSpacing = !empty($column['height']) ? $column['height'] : $height;
11091109
$fontSize = empty($column['font_size']) ? 10 : $column['font_size'];
11101110
foreach ($column['text'] as $part) {
1111-
if ($this->y - $lineSpacing < 15) {
1111+
if ($this->y - $top < 15) {
11121112
$page = $this->newPage($this->pageSettings);
1113+
$top = 0;
11131114
}
11141115

11151116
$feed = $column['feed'];

0 commit comments

Comments
 (0)