In the framework of the perturbative Quantum Chromodynamics factorization, the cross section of the heavy meson production via the combination of a heavy quark with a light one can be factorized to be the convolution of the combination matrix element, the light quark distribution function, and the hard partonic sub-cross section of the heavy quark production. The partonic distribution and the combination matrix element are functions of a scaling variable, respectively, which is the momentum fraction of the corresponding quark with respect to the heavy meson. We studied the $D^{*pm}$ production in jet via combination in pp collision at the LHC. Our calculation can be summed with the fragmentation contribution, and the total result is comparable with the experimental data. The combination matrix elements can be further studied in various hadron production processes.