[Skip to main content](#vessel-content)

#   pdf attach invoice layout problem

##

- **[jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")**
- [![jouwnaambord.nl's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile") Topic Author
- [ Offline](/forum/user/1188-jouwnaambord-nl)

Less More

- Posts: 515
- Thank you received: 22
-
-

5 years 10 months ago [\#327970](#327970) by [jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")  *[pdf attach invoice layout problem](/forum/30-integrations/901608-pdf-attach-invoice-layout-problem#327970 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.23 -- PHP version -- : 7.4  Hi,  I just purchased the latest attach pdf invoice plugin. For some products (or options) the textline is longer. This breaks the pdf layout, see screenshot. In the &quot;old&quot; plugin I didn't have that problem. How can I solve this?")* was created by *[jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")*

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.23
-- PHP version -- : 7.4

Hi,

I just purchased the latest attach pdf invoice plugin. For some products (or options) the textline is longer. This breaks the pdf layout, see screenshot. In the "old" plugin I didn't have that problem. How can I solve this?

- [ ![pdf-attach-invoice.jpg](/forum/attachment/51577) ](/forum/attachment/51577 "...ch-invoice.jpg") [ ](/forum/attachment/51577?download=1 "...ch-invoice.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy85MDE2MDgtcGRmLWF0dGFjaC1pbnZvaWNlLWxheW91dC1wcm9ibGVtP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

5 years 10 months ago [\#327974](#327974) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[pdf attach invoice layout problem](/forum/30-integrations/901608-pdf-attach-invoice-layout-problem#327974 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.23 -- PHP version -- : 7.4  Hi,  I just purchased the latest attach pdf invoice plugin. For some products (or options) the textline is longer. This breaks the pdf layout, see screenshot. In the &quot;old&quot; plugin I didn't have that problem. How can I solve this?")*

Hi,

From what I can see, the issue comes from the name of the option which is too long.
There is already code to avoid that for the product name, but there is indeed no code to handle that for options.
However, that was never the case, so you must have had the same issue before but never noticed.
To fix that, change the code: Code:

echo $optionElement-&gt;order_product_name; if($optionElement-&gt;order_product_price&gt;0 &amp;&amp; !$this-&gt;shipping_invoice){ if($config-&gt;get('price_with_tax')){ echo ' ( + '.$currencyHelper-&gt;format($optionElement-&gt;order_product_price+$optionElement-&gt;order_product_tax,$order-&gt;order_currency_id).' )'; }else{ echo ' ( + '.$currencyHelper-&gt;format($optionElement-&gt;order_product_price,$order-&gt;order_currency_id).' )'; } }

to: Code:

$option_name = $optionElement-&gt;order_product_name; if($optionElement-&gt;order_product_price&gt;0 &amp;&amp; !$this-&gt;shipping_invoice){ if($config-&gt;get('price_with_tax')){ $option_name .= ' ( + '.$currencyHelper-&gt;format($optionElement-&gt;order_product_price+$optionElement-&gt;order_product_tax,$order-&gt;order_currency_id).' )'; }else{ $option_name .= ' ( + '.$currencyHelper-&gt;format($optionElement-&gt;order_product_price,$order-&gt;order_currency_id).' )'; } } echo '&lt;p&gt;'.implode('&lt;br/&gt;', $this-&gt;str_split_unicode(strip_tags($option_name),50));

in the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy85MDE2MDgtcGRmLWF0dGFjaC1pbnZvaWNlLWxheW91dC1wcm9ibGVtP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")**
- [![jouwnaambord.nl's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile") Topic Author
- [ Offline](/forum/user/1188-jouwnaambord-nl)

Less More

- Posts: 515
- Thank you received: 22
-
-

5 years 10 months ago [\#327987](#327987) by [jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")  Replied by *[jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")* on topic *[pdf attach invoice layout problem](/forum/30-integrations/901608-pdf-attach-invoice-layout-problem#327987 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.23 -- PHP version -- : 7.4  Hi,  I just purchased the latest attach pdf invoice plugin. For some products (or options) the textline is longer. This breaks the pdf layout, see screenshot. In the &quot;old&quot; plugin I didn't have that problem. How can I solve this?")*

Hi Nicolas,

Thanks for your solution. There must be some small mistake in the code, after changing I get the errormessage: "1 Tags are closed in a wrong order for [td]"

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy85MDE2MDgtcGRmLWF0dGFjaC1pbnZvaWNlLWxheW91dC1wcm9ibGVtP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

5 years 10 months ago [\#327988](#327988) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[pdf attach invoice layout problem](/forum/30-integrations/901608-pdf-attach-invoice-layout-problem#327988 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.23 -- PHP version -- : 7.4  Hi,  I just purchased the latest attach pdf invoice plugin. For some products (or options) the textline is longer. This breaks the pdf layout, see screenshot. In the &quot;old&quot; plugin I didn't have that problem. How can I solve this?")*

Hi,

Ah yes, the line :
echo '&lt;p&gt;'.implode('&lt;br/&gt;', $this-&gt;str_split_unicode(strip_tags($option_name),50));
should be:
echo '&lt;p&gt;'.implode('&lt;br/&gt;', $this-&gt;str_split_unicode(strip_tags($option_name),50)).'&lt;/p&gt;';

The following user(s) said Thank You: [jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy85MDE2MDgtcGRmLWF0dGFjaC1pbnZvaWNlLWxheW91dC1wcm9ibGVtP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")**
- [![jouwnaambord.nl's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile") Topic Author
- [ Offline](/forum/user/1188-jouwnaambord-nl)

Less More

- Posts: 515
- Thank you received: 22
-
-

5 years 10 months ago [\#328032](#328032) by [jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")  Replied by *[jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")* on topic *[pdf attach invoice layout problem](/forum/30-integrations/901608-pdf-attach-invoice-layout-problem#328032 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.23 -- PHP version -- : 7.4  Hi,  I just purchased the latest attach pdf invoice plugin. For some products (or options) the textline is longer. This breaks the pdf layout, see screenshot. In the &quot;old&quot; plugin I didn't have that problem. How can I solve this?")*

Yes, thank you, this works fine!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy85MDE2MDgtcGRmLWF0dGFjaC1pbnZvaWNlLWxheW91dC1wcm9ibGVtP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.049 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
