Collinear parton distribution functions (cPDFs) and transverse momentum dependent distributions (TMDs) are essential for calculating cross sections in high-energy physics, particularly within collinear and -factorization frameworks. Currently, there exists two libraries, such as LHAPDF and TMDLib, to obtain these physical objects. However, there are limitations in both libraries, especially for TMDs, such as restricted customization and extensibility. Users are limited to the implementations provided by these libraries and cannot easily support unconventional PDFs. Additionally, no standard TMD library currently supports calculations of QCD coupling and uncertainties, which are crucial for precise phenomenological studies. To address these shortcomings, we introduce PDFxTMDLib, a modern C++ library designed to offer a robust and flexible solution. This library supports both collinear PDFs and TMDs while allowing greater customization. It also opens the way to support higher-order distributions. In this article, we describe the structure of PDFxTMDLib. We also demonstrate its validity and performance by integrating it into the PYTHIA Monte Carlo event generator to compute Drell-Yan cross sections. Additionally, comparisons of PDFs obtained from PDFxTMDLib with those from LHAPDF.and TMDLib confirm the reliability of PDFxTMDLib's results.