PDF printing error
-
PDF printing error, strange characters appear in the product description line
-
Hello @alberto17
Can you show us a screenshot of the problem? You could host the image here.
Thanks for your interest
Have you received the screenshot?
Hi @alberto17
You need to paste the image link here in a reply.
If I activate the Send as HTML check, all the text can be seen correctly. I have the problem only with PDF
Hi @alberto17,
Are you using a custom template? If so, can you try to change it temporary to Simple, under WooCommerce > PDF Invoices > General > Choose a template, and try again?
No estoy utilizando una plantilla personalizada.
Voy a intentar descargar el plugin en otra web para ver si hace lo mismo. Es muy extraΓ±o todo esto.
Os tengo informados.
Muchas gracias por vuestro apoyo πI am not using a custom template.
I will try to download the plugin on another website to see if it does the same. This is very strange.
I have you informed.
Thanks a lot for your support πThat would be very useful, @alberto17!
Meanwhile, could you tell me if the product name (the one that displayed in your screenshot) uses special characters? If possible, could you copy and paste the product name into a reply here?
I have downloaded the plugin on another of my websites and it works correctly.
I have noticed that the font of the article on the web keeps it in the order list in woocommerce and it must be that it does not recognize that font.
What do you think?Good catch! That was also my guess. Please try adding this code snippet to your site to see if fix this issue:
/** * Force the font-family to 'Open Sans', san-serif */ add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_custom_styles', 10, 2 ); function wpo_wcpdf_custom_styles ( $document_type, $document ) { if ( $document_type == 'invoice' ) { ?> body, span.item-name, span.item-meta { font-family: 'Open Sans', sans-serif !important; } <?php } }If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters
Let me know if it worked!
Hi Yordan,
I sincerely appreciate your perseverance.
I have put the code snippet but it has not fixed the problem.I see. Could you please remove the previous code and add this one instead, and try again:
add_filter( 'wpo_wcpdf_order_item_data', function( $item, $order, $template_type ) { $item['name'] = strip_tags( $item['name'] ); return $item; }, 10, 3 );Also, could you please send a screenshot of the order related with the invoice in your screenshot?

An example of the order data
The topic ‘PDF printing error’ is closed to new replies.