- clone the project
git clone https://github.com/getNavneet/ChatGPT-html-page2pdf- install dependencies
cd ChatGPT-html-page2pdf
npm install- run the script with your local html file
node localToPdf.js your-file.html-
Save the ChatGPT conversation as an HTML page
→ PressCtrl + S(or right-click → Save as...) on the chat page. -
Run the script with the file path:
node index.js path/to/file.htmlexample if you have html page in same directory
node index.js ChatGPT.htmlThis will generate a PDF file in the output folder.
- Node.js
- libraries (puppeteer winston)
The generated PDF files will be saved in the output folder.
This script is particularly useful if you are using the chatGPT without logged in and there is no browser extension you have installed already and in this case you get difficult to save the chat and this script is created particularly for that one edge case i faced recently.