pyboxbuilder.export.layout_pdf.should_regenerate_layout

pyboxbuilder.export.layout_pdf.should_regenerate_layout(packing: BoxPacking, pdf_path: Path, library_version: str = '1.4.0') → bool[source]

Check whether the PDF needs regeneration.

Uses SHA-256 hash of packing layout + library version. If the PDF doesn’t exist or the hash differs, regeneration is needed.

Parameters:
packing: BoxPacking

The current packing layout.

pdf_path: Path

Path to the existing PDF file.

library_version: str = '1.4.0'

Version string for cache invalidation.

Returns:

True if PDF should be regenerated, False if existing is current.