Error when change widht of the paper
-
Hi, you have a really nice plugin I just having a problem with it.
I already fix it but not in a nice way, because everytime the plugin gets an upgrade I need to edit the files again.
Here is a Video of the error: https://youtu.be/PclJOwuDzt8
The error occurs when I add this code in a custom plugin:
add_filter( ‘wpo_wcpdf_paper_format’, ‘wcpdf_custom_mm_page_size’, 10, 2 );
function wcpdf_custom_mm_page_size($paper_format, $template_type) {
// change the values below
$width = 58; //mm!
$height = 100; //mm!//convert mm to points
$paper_format = array( 0, 0, ($width/25.4) * 72, ($height/25.4) * 72 );return $paper_format;
}When the order have too many items, the fatal error appear.
I fix it erasing this:
// Assume the position of the first child
[$x, $y] = $frame->get_first_child()->get_position();
$frame->set_position($x, $y);From here: wp-content>plugins>woocommerce-pdf-invoices-packing-slips>vendor>dompdf>dompdf>src>FrameReflower>Inline.php
I dont have almost any knowledge about coding, but it fix it and still working good.
I just want to know if there is another way to fix it, than erase that code everytime the plugin get updated.
Thanks for the help.
- The topic ‘Error when change widht of the paper’ is closed to new replies.