A general near-field (NF) in-band synthesis strategy is presented for the direct layout optimization (DLO) of reflectarrays with application to the generation of plane waves for the mm-wave band. The technique relies on the definition of relevant figures of merit (FoM) and the use of a gradient-based minimization algorithm. To this end, the volume where the NF is computed is divided into a number of disjoint regions where the FoM are defined. These FoM define the performance of the antenna and their direct optimization enables improvement compared to previous approaches described in the literature, while reducing the memory footprint of the algorithm and accelerating computation. The optimization procedure is divided into several stages to facilitate convergence towards a successful outcome. First, a phase-only synthesis is carried out at a single frequency. Then, a reflectarray layout is obtained using a method of moments based on local periodicity, accounting for mutual coupling between elements. Finally, an in-band DLO is performed at a number of frequencies directly optimizing the FoM. The results show that the obtained reflectarray layout complies with the requirements in the frequency range 27 GHz–29 GHz within the 5G new radio n257 band.