Printed packaging defect detection in industrial production is challenged by complex background textures, small defect sizes, and the need for real-time processing on resource-limited devices. To address these issues, we propose PYOLO-PCF (printing YOLO with package-context fusion), a lightweight and context-aware multi-scale detection framework tailored for heterogeneous printed packaging environments. The backbone integrates RepGhost convolution with GSConv to achieve efficient fine-grained feature extraction, while the neck incorporates dual-channel spatial pyramid fusion (DCSPF) to separately process low-frequency structural and high-frequency texture information for robust feature fusion. A hybrid attention mechanism, combining triplet attention and polarized self-attention (PSA), enhances defect saliency while suppressing background noise. Furthermore, CARAFE[Formula: see text] upsampling with SimAM attention improves geometric consistency in small-defect reconstruction, and the detection head employs a hybrid task cascade (HTC) structure optimized with scalable intersection over union (SIoU) loss for precise localization. Extensive experiments on the newly constructed P-PackDefect-2025 dataset, covering three industrial printing processes (silk screen, flexographic, and relief printing), demonstrate that PYOLO-PCF achieves an mAP@0.5 of 0.812 and a defect recall rate (DRR) of 95.6%, outperforming state-of-the-art lightweight detectors while maintaining a real-time inference speed of 46 FPS (frames per second) on an NVIDIA Jetson Xavier NX. Ablation studies confirm that each proposed component contributes to accuracy gains, with the full model offering a 3–5% mAP improvement over strong baselines. The proposed PYOLO-PCF provides an effective balance between accuracy, speed, and model complexity, making it well-suited for deployment in industrial quality inspection systems where high precision and real-time operation are critical.