The pseudo-spectral method with the Chebyshev and Legendre polynomials are used in order to compute the electric potential for a rodlike macromolecule located in salt free solution via the Poisson-Boltzmann equation (PBE). Afterwards, verification of the method is demonstrated for a long macromolecule as well as a large plate for which the behaviors can be properly explained by a one-dimensional PBE. It is concluded that the method based upon the Chebyshev polynomials with the specified collocation points is more accurate than the technique based on the Legendre polynomials with the same number of points. As a macromolecule has a rodlike shape, a two-dimensional PBE is considered, which corresponds to a much more realistic case. To solve the PBE, the concentration of the macromolecule in the solution and the electric field are used to compute the height and radius of the unit cell, which are obtained to be as 16.7 and 8.1 nm, respectively. It is worth noting that numerical computation of the PBE for a macromolecule with a finite length has not been reported previously using the pseudo-spectral method. The results given in this work can be appropriately used for stiff fragments of DNA and actin filaments.