ChatGPT to PDF is a free and open-source Chrome extension that allows you to save your ChatGPT and other chat conversations as PDF documents. With features like unlimited message selection and full conversation export, you can easily archive your chats without any premium costs or advertisements.
- Save Full Conversations: Export entire ChatGPT conversations as high-quality PDFs.
- Selective Message Saving: Choose specific messages to include in your PDF export.
- Easy-to-Use Interface: A simple button group appears within the ChatGPT interface for quick access.
- Customizable PDF Output: Generates PDFs with clean formatting and page breaks optimized for readability.
- Open Source: Fully transparent code with no hidden features, ads, or premium paywalls.
-
Clone or Download the Repository:
git clone https://github.com/yourusername/chatgpt-to-pdf.git
or download the ZIP archive and extract it.
-
Load the Extension in Chrome:
- Open Chrome and navigate to
chrome://extensions/. - Enable Developer mode (toggle in the top right).
- Click on Load unpacked and select the directory where you cloned or extracted the repository.
- Open Chrome and navigate to
-
Start Using the Extension:
- Navigate to ChatGPT (or the site matching the host permissions).
- The extension will automatically inject a button group near the profile button for PDF saving options.
-
Saving a Conversation:
- Click the "Save to PDF" button that appears near your profile button.
- The extension will automatically detect and export the entire conversation as a PDF named
selected_messages.pdfif no messages are selected.
-
Selecting Specific Messages:
- Click the dropdown toggle (▼) to reveal additional options.
- Select "Select Messages". This will enable a mode where each message becomes clickable.
- Click on individual messages to mark them for selection. The button text will update with the count of selected messages.
- Click "Save X Selected Messages" to export only the chosen messages.
- To cancel selection mode, click the "X" (cancel button).
-
PDF Generation:
- The extension uses html2pdf to convert HTML content to PDF with configurable options such as margins, image quality, and page breaks.
content.js: Contains the main logic for detecting DOM changes, inserting the PDF save buttons, and handling user interactions.html2pdf.bundle.min.js: A bundled library used for converting HTML content to PDF.style.css: Custom styles for the extension's UI elements.manifest.json: Defines the extension's metadata, permissions, and file associations.
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and ensure code quality with proper comments and testing.
- Submit a pull request describing your changes.
If you want to modify or test the extension locally:
- Clone the repository.
- Make the necessary changes in your local environment.
- Load the unpacked extension in Chrome via
chrome://extensions/.
This project is licensed under the MIT License.
- html2pdf.js: Thanks to eKoopmans for providing a robust solution for HTML-to-PDF conversion.
- ChatGPT: For inspiring the project and providing an engaging platform for conversation archiving.
Happy chatting and saving! If you have any questions or feedback, please open an issue or contact the maintainer.