Extend WooCommerce PDF catalog generation
The modern WooCommerce PDF catalog module exposes two filters for controlled generation and category-page output. Enable it under Settings → POM Tweaks → E-Commerce → Products → PDF catalog and confirm WooCommerce is active.
Products per processing request
apply_filters(
'pom_tweaks_wc_pdf_catalog_products_per_chunk',
int $products_per_chunk,
array $catalog
);
The default is 24. Return a positive integer; POM Tweaks clamps values below 1 to 1. A larger value reduces the number of processing requests but increases the work and memory used by each request.
add_filter(
'pom_tweaks_wc_pdf_catalog_products_per_chunk',
static function ( int $size, array $catalog ): int {
return 12;
},
10,
2
);
Category page HTML
apply_filters(
'woocommerce_pdf_catalog_category_html',
string $html,
int $term_id
);
The filter receives the complete category-page fragment and the product-category term ID. Return an HTML string compatible with the catalog renderer.
add_filter(
'woocommerce_pdf_catalog_category_html',
static function ( string $html, int $term_id ): string {
$note = get_term_meta( $term_id, 'catalog_note', true );
if ( ! is_string( $note ) || $note === '' ) {
return $html;
}
return $html . '<p>' . esc_html( $note ) . '</p>';
},
10,
2
);
Use trusted, valid markup and avoid scripts, remote requests, or expensive queries during rendering. Generate a catalog containing several categories after every change and inspect page breaks, typography, images, and memory use.
See Generate WooCommerce PDF catalogs for the complete generation workflow.