Hi @greentktx,
This is indeed possible, although we do not offer this page size by default, since our default Simple template is not prepared for small layouts, but you can always set your own customizations by your own. See: Use custom page size/orientation & Using custom styles.
That said, I have written two code snippets, as a courtesy for you, so you can achieve this faster and effortless.
The first, set the packing slip page/paper size to 4×6 inches:
/**
* PDF Invoices & Packing Slip for WooCommerce:
* Set the paper size to 4x6 inches
*/
add_filter( 'wpo_wcpdf_paper_format', function( $paper_format, $document_type ) {
if ( $document_type == 'packing-slip' ) {
// change the values below
$width = 4; //inches!
$height = 6; //inches!
//convert inches to points
$paper_format = array( 0, 0, $width * 72, $height * 72 );
}
return $paper_format;
}, 10, 2 );
The second, adds some CSS rules to customize the packing slip styles*, in order to adapt our default layout to this small page/paper size:
/**
* PDF Invoices & Packing Slip for WooCommerce:
* Add custom styles to the PDF documents
*/
add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) {
if ( $document_type == 'packing-slip' ) {
?>
/*Reduce page margins*/
@page {
margin-top: .5cm;
margin-bottom: .5cm;
margin-left: .5cm;
margin-right: .5cm;
}
/* Document label */
h1 {
font-size: 8pt;
}
/* Shop name and other labels */
h3, h4 {
font-size: 7pt;
}
/* Document body and order table */
body {
font-size: 7pt;
}
dt, dd, dd p, .wc-item-meta {
font-size: 6pt;
}
<?php
}
}, 10, 2 );
If you haven’t worked with code snippets (actions/filters) or functions.php
before, read this guide: How to use filters
Let me know whether you managed to make it work or you need more help!
* FYI: There is another way to achieve the same, creating a custom PDF template, but please note that we do not provide assistance for it for free. Even if you have a license for either Professional extension or Premium Templates, we only offer help for this as a custom job for an extra fee, since this is an advanced customization which involves more time and work (and I believe it is not necessary for your particular case ;)).