Issue with HTML to PDF Conversion in Node.js
03:25 21 Jan 2026

When generating PDFs, the page border either touches or gets cut off at the page edges. Even when the border looks correct, the content overlaps the border during page breaks. I am facing multiple issues related to margin, padding, and page-breaking behavior.

I want to understand:

  • How to correctly set margins or padding based on border width

  • How page-breaking functionality should be implemented

  • How to prevent content from overlapping the page border

I am looking for a proper and easy solution, similar to Puppeteer, which is working well in production.




    
    
    Bio-Data - Traditional
    
    


    
Bio - Data

Personal Details

Name:
Gender:
Date Of Birth:
Age:
Marital Status:
Height Unit: Feet
Height:
Complexion:
Time Of Birth:
Place Of Birth:
Gotra/Caste:
Education:
Occupation:
Income:

Family Details

Father's Name:
Mother's Name:
Father's Occupation:
Mother's Occupation:
Brother Name (Elder):
Brother's Occupation (Elder):
Brother Name (Younger):
Brother's Occupation (Younger):
Sister Name (Elder):
Sister's Occupation (Elder):
Sister Name (Younger):
Sister's Occupation (Younger):
Family Type:
Family Values:

Contact Details

Contact Number:
Contact Email:
WhatsApp Number:
Contact Person:
Residential Address:
City:
State:
 
javascript css node.js puppeteer pdf-generation