- Posts: 13
- Thank you received: 0
PDF Invoice Plugin Cutting Off
- dklotz1286
-
Topic Author
- Offline
Less
More
12 years 5 months ago #152749
by dklotz1286
PDF Invoice Plugin Cutting Off was created by dklotz1286
I have the latest version of PDF Plugin as I just installed it. When I open all of my invoices most of them are getting cut off. How can I fix this? I have attached a screen shot.
Please Log in or Create an account to join the conversation.
12 years 5 months ago #152759
by nicolas
Replied by nicolas on topic PDF Invoice Plugin Cutting Off
Hi,
That's because your product names are too long. You'll have to change the line:
by:
in the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php
and add the code:
before the line:
in the file plugins/hikashop/attachinvoice/attachinvoice.php
That way, it will split the product names into several lines when they are too big to fit on a line.
That's because your product names are too long. You'll have to change the line:
Code:
<?php echo $product->order_product_name;
Code:
<?php echo implode('<br/>',$this->str_split_unicode($product->order_product_name,50));
and add the code:
Code:
function str_split_unicode($str, $l = 0) {
if ($l > 0) {
$ret = array();
$len = mb_strlen($str, "UTF-8");
for ($i = 0; $i < $len; $i += $l) {
$ret[] = mb_substr($str, $i, $l, "UTF-8");
}
return $ret;
}
return preg_split("//u", $str, -1, PREG_SPLIT_NO_EMPTY);
}
Code:
}//endclass
That way, it will split the product names into several lines when they are too big to fit on a line.
Please Log in or Create an account to join the conversation.
Time to create page: 0.139 seconds