Overflow of Print Format while generating PDF

Dear Community,
I am trying to generate a print format using custom HTML. The problem is the overflowing items table, which is not fitting in the portrait mode while using the PDF generator option. However, if I use the print generator of the browser it works fine. Below are the screen shots in both cases. Can you identify what is going on here?

Through PDF

Through Browser Print