Industry 4.0 aims to integrate manufacturing operations into a seamless digital whole by incorporating flexibility, agility, re-configurability, and sustainability. The result of this integration is a "smart factory" that is more lean, agile, and flexible in operations. There are valid reasons, and perhaps requirements, for pharmaceutical industries to embrace smart factory and to "borrow" the concept of Industry 4.0 to give rise to "Pharma 4.0" (i.e., the pharmaceutical version of Industry 4.0). This paper proposes a cyber-physical-based PAT framework called CPbPAT for implementing smart manufacturing systems in the pharmaceutical industry. The framework has been developed using an agent-based system and is presented by a standard system modeling language called the Unified Modeling Language (UML). The pharmaceutical manufacturing system shown in "Quality by Design for ANDAs" is used as a case study to illustrate the application of the proposed framework.