Skip to main content

PDF Invoice Plugin Cutting Off

More
12 years 5 months ago #152749 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.

More
12 years 5 months ago #152759 by nicolas
Hi,

That's because your product names are too long. You'll have to change the line:
Code:
<?php echo $product->order_product_name;
by:
Code:
<?php echo implode('<br/>',$this->str_split_unicode($product->order_product_name,50));
in the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php
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); }
before the line:
Code:
}//endclass
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.

Please Log in or Create an account to join the conversation.

Time to create page: 0.139 seconds
Powered by Kunena Forum