This program converts a input CSV file of mailing addresses and generates a single PDF file with one page per address.
Response,Mailing Line 1,Mailing Line 2,City,State,Zip Code
John Smith,123 Main St,APT 10,New York City,NY,10001
Test Name,Test Line 1,Test Line 2,City Name,ST,12345
- Download & install
wkhtmltopdf
. See https://wkhtmltopdf.org/ for directions. - Run
npm install
inside this folder to install node dependencies
npm run convert input.csv output.pdf
- To edit paper size & CSV column fields, modify
index.js
- To update design of the page, edit
style.css
file
- Ensure printer drivers are installed on computer from factory
- Ensure printer has set correct paper size
- Selected the same paper size on the printing preferences
- To debug HTML/CSS formatting issues, open
tmp/output.html
in a web browser - To debug
wkhtmltopdf
run program directly ontmp/output.html
to see full output