This paper reports the synthesis of a new heterocyclic compound, 2,7-dicloropyrido[2,3-g]quinoline-3,8-dicarbaldehyde, from p-phenylene diamine by converting p-acetanilide (1) and reacting with Vilsmeier-Haack reagent (2). Chalcone(3) is produced when two moles of 2-acetyl naphthalene respond with the two carbaldehydes in compound (2). This chalcone serves as a reagent for quantifying amino group-containing pharmaceutical compounds. At the same time, a sensitive spectrophotometric technique has been created and used in pharmaceutical preparations to measure cefotaxime sodium by diazotizing and coupling with chalcone reagent. The recommended method diazotizes the medicinal molecule with sodium nitrite in an acidic solution to form the diazonium salt. This salt is combined with Chalcone reagent in an essential medium to create a stable and colorful azo dye soluble in water. Maximum absorption of the product is shown at 406 nm. Throughout the concentration range of 0.5–30 µg/ml, Beer's law was followed. The M absorptivity was (18381.44) liters mol-1. cm-1, the average recovery rate was 100.48 percent, and the relative standard deviation was less than 0.9 %. Injection-ready pharmaceutical preparations were the focus of the methodology.