Title: pdf capability
Last modified: November 27, 2020

---

# pdf capability

 *  [potterleung](https://wordpress.org/support/users/potterleung/)
 * (@potterleung)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/pdf-capability/)
 * I added product description in invoice.php, but my description is long that the
   words can’t cross over a page in pdf. How can I solve this problem? Cause my 
   item need a long desciption
 * <?php
    if (!empty($item[‘product’])) { $_product = $item[‘product’]->is_type(‘
   variation’ ) ? wc_get_product( $item[‘product’]->get_parent_id() ) : $item[‘product’];
   if ( method_exists( $_product, ‘get_description’ ) ) { echo $_product->get_description();}}?
   >
 * I added this coding in <table class=”order-details”>
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fpdf-capability%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/pdf-capability/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/pdf-capability/page/2/?output_format=md)

 *  Plugin Contributor [alexmigf](https://wordpress.org/support/users/alexmigf/)
 * (@alexmigf)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/pdf-capability/#post-13715655)
 * Hello [@potterleung](https://wordpress.org/support/users/potterleung/)
 * Please try this instead:
 *     ```
       <?php
       	if (!empty($item[‘product’])) {
       		$_product = $item[‘product’]->is_type( ‘variation’ ) ? wc_get_product( $item[‘product’]->get_parent_id() ) : $item[‘product’];
       		if ( method_exists( $_product, ‘get_description’ ) ) {
       			echo '<div style="word-wrap:break-word;">'.$_product->get_description().'</div>';
       		}
       	}
       ?>
       ```
   
 * Let me know.
 *  Thread Starter [potterleung](https://wordpress.org/support/users/potterleung/)
 * (@potterleung)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/pdf-capability/#post-13716346)
 * sorry this is not work for me
 *  Plugin Contributor [alexmigf](https://wordpress.org/support/users/alexmigf/)
 * (@alexmigf)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/pdf-capability/#post-13716419)
 * Hi [@potterleung](https://wordpress.org/support/users/potterleung/)
 * Well, I test myself and is working fine, but maybe because of the apostrophes
   are wrong could lead to an error, try this:
 *     ```
       <?php
       	if (!empty($item['product'])) {
       		$_product = $item['product']->is_type( 'variation' ) ? wc_get_product( $item['product']->get_parent_id() ) : $item['product'];
       		if ( method_exists( $_product, 'get_description' ) ) {
       			echo '<div style="word-wrap:break-word;">'.$_product->get_description().'</div>';
       		}
       	}
       ?>
       ```
   
 *  Thread Starter [potterleung](https://wordpress.org/support/users/potterleung/)
 * (@potterleung)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/pdf-capability/#post-13716464)
 * Can show the product description but the description can’t display over a page
   in pdf which inside <table>.
 * [https://myweb.hk/wp-admin/admin-ajax.php?action=generate_wpo_wcpdf&document_type=invoice&order_ids=4710&_wpnonce=583ec8fd2f](https://myweb.hk/wp-admin/admin-ajax.php?action=generate_wpo_wcpdf&document_type=invoice&order_ids=4710&_wpnonce=583ec8fd2f)
 * You can see the second and third product item description can’t show all of them.
 * My invoice.php at below:
    [https://drive.google.com/file/d/1vhOEafEx1rge1yfQb4Drjd9KyJrve-v5/view?usp=sharing](https://drive.google.com/file/d/1vhOEafEx1rge1yfQb4Drjd9KyJrve-v5/view?usp=sharing)
 * table coding:
    <table class=”order-details”> <thead> <tr> <th class=”product”
   ><?php _e(‘Product’, ‘woocommerce-pdf-invoices-packing-slips’ ); ?></th> <th 
   class=”quantity”><?php _e(‘Quantity’, ‘woocommerce-pdf-invoices-packing-slips’);?
   ></th> <th class=”price”><?php _e(‘Price’, ‘woocommerce-pdf-invoices-packing-
   slips’ ); ?></th> </tr> </thead>
 *  <tbody>
    <?php $items = $this->get_order_items(); if( sizeof( $items ) > 0 ):
   foreach( $items as $item_id => $item ) : ?> <tr class=”<?php echo apply_filters(‘
   wpo_wcpdf_item_row_class’, $item_id, $this->type, $this->order, $item_id ); ?
   >”> <td class=”product”> <?php $description_label = __( ‘Description’, ‘woocommerce-
   pdf-invoices-packing-slips’ ); // registering alternate label translation ?> 
   <span class=”item-name”><?php echo $item[‘name’]; ?></span> <?php do_action( ‘
   wpo_wcpdf_before_item_meta’, $this->type, $item, $this->order ); ?> <span class
   =”item-meta”><?php echo $item[‘meta’]; ?></span> <div class=”meta”> <?php if (!
   empty($item[‘product’])) { $_product = $item[‘product’]->is_type( ‘variation’)?
   wc_get_product( $item[‘product’]->get_parent_id() ) : $item[‘product’]; if ( 
   method_exists( $_product, ‘get_description’ ) ) { echo ‘<div style=”word-wrap:
   break-word;”>’.$_product->get_description().'</div>’; } } ?> <?php do_action(‘
   wpo_wcpdf_after_item_meta’, $this->type, $item, $this->order ); ?> </td>
 *  <td class=”quantity”><?php echo $item[‘quantity’]; ?></td>
    <td class=”price”
   ><?php echo $item[‘order_price’]; ?></td> </tr> <?php endforeach; endif; ?>
 *  Thread Starter [potterleung](https://wordpress.org/support/users/potterleung/)
 * (@potterleung)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/pdf-capability/#post-13716481)
 * [https://drive.google.com/file/d/1-JNYOyGXPEcFSBPuKRlLz8DWtkhPmbMA/view?usp=sharing](https://drive.google.com/file/d/1-JNYOyGXPEcFSBPuKRlLz8DWtkhPmbMA/view?usp=sharing)
 * this is the outlook of invoice my preference :((
 *  Plugin Contributor [alexmigf](https://wordpress.org/support/users/alexmigf/)
 * (@alexmigf)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/pdf-capability/#post-13724816)
 * Hi [@potterleung](https://wordpress.org/support/users/potterleung/)
 * Does the product description take the whole page?
 *  Thread Starter [potterleung](https://wordpress.org/support/users/potterleung/)
 * (@potterleung)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/pdf-capability/#post-13728570)
 * hi [@alexmigf](https://wordpress.org/support/users/alexmigf/). Yes, it over a
   whole page cause a lot of words.
 *  Plugin Contributor [alexmigf](https://wordpress.org/support/users/alexmigf/)
 * (@alexmigf)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/pdf-capability/#post-13734227)
 * Hi [@potterleung](https://wordpress.org/support/users/potterleung/)
 * If is taking the full height of the page the only solution is to decrease the
   font size of it, and even that couldn’t be enough.
 * Try this:
 *     ```
       <?php
       	if (!empty($item['product'])) {
       		$_product = $item['product']->is_type( 'variation' ) ? wc_get_product( $item['product']->get_parent_id() ) : $item['product'];
       		if ( method_exists( $_product, 'get_description' ) ) {
       			echo '<div style="word-wrap:break-word; font-size:6pt; line-height:normal;">'.$_product->get_description().'</div>';
       		}
       	}
       ?>
       ```
   
 *  Thread Starter [potterleung](https://wordpress.org/support/users/potterleung/)
 * (@potterleung)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/pdf-capability/#post-13735346)
 * It’s sad that this is not work for me. the words is too small and my description
   is much more. I found that if the description not in table which can over a page,
   but will be not organized if more that one product. Maybe I try to find other
   plugin to fix it.
 *  Plugin Contributor [alexmigf](https://wordpress.org/support/users/alexmigf/)
 * (@alexmigf)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/pdf-capability/#post-13739647)
 * Hi [@potterleung](https://wordpress.org/support/users/potterleung/)
 * The order items work as a block, when the page doesn’t have space enough for 
   it’s height it goes to the next page. In your case the height is superior to 
   the page available space, even if the item is alone it’s height is superior to
   the space available and that’s why he gets cut.
 * Unfortunately I’m not seeing a solution for that but I will ask my colleagues
   if they have another idea.
 *  Thread Starter [potterleung](https://wordpress.org/support/users/potterleung/)
 * (@potterleung)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/pdf-capability/#post-13744050)
 * [https://myweb.hk/wp-admin/admin-ajax.php?action=generate_wpo_wcpdf&document_type=invoice&order_ids=4807&_wpnonce=4f600842c9](https://myweb.hk/wp-admin/admin-ajax.php?action=generate_wpo_wcpdf&document_type=invoice&order_ids=4807&_wpnonce=4f600842c9)
 * The price is showing with 2 row:
    $ 9,600.00
 * How can let it be one row: $9,600.00
 *  Plugin Contributor [alexmigf](https://wordpress.org/support/users/alexmigf/)
 * (@alexmigf)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/pdf-capability/#post-13744381)
 * Hi [@potterleung](https://wordpress.org/support/users/potterleung/)
 * Can you add a screenshot [here](https://imgbb.com/)?
 *  Thread Starter [potterleung](https://wordpress.org/support/users/potterleung/)
 * (@potterleung)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/pdf-capability/#post-13744837)
 * [https://myweb.hk/wp-content/uploads/2020/12/priceing.png](https://myweb.hk/wp-content/uploads/2020/12/priceing.png)
   
   here
 *  Thread Starter [potterleung](https://wordpress.org/support/users/potterleung/)
 * (@potterleung)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/pdf-capability/#post-13744842)
 * [https://ibb.co/JFCQqG4](https://ibb.co/JFCQqG4)
 *  Thread Starter [potterleung](https://wordpress.org/support/users/potterleung/)
 * (@potterleung)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/pdf-capability/#post-13745747)
 * Another question, how can I no show payment method and payment instruction in
   the total section?

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/pdf-capability/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/pdf-capability/page/2/?output_format=md)

The topic ‘pdf capability’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

## Tags

 * [product description](https://wordpress.org/support/topic-tag/product-description/)

 * 16 replies
 * 2 participants
 * Last reply from: [alexmigf](https://wordpress.org/support/users/alexmigf/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/pdf-capability/page/2/#post-13745840)
 * Status: not resolved