chrrel / whatsapp-exporter

A python script for extracting WhatsApp conversations from the app's SQLite database and exporting them as HTML or txt files.
GNU General Public License v3.0
93 stars 18 forks source link

Export specific chat to pdf? #14

Closed Buster14 closed 9 months ago

Buster14 commented 9 months ago

First of all, just wanna thank you for a great job! by far this is the cleanest solution. Just wondering if there is any way to export a specific chat to pdf? I'm trying to use it as an evidence for suing my dad's scammer but they said it would be easier to read for everyone if its in pdf. I googled a bit there doesn't seem to be a solution for this yet, but please CMIIW.

chrrel commented 9 months ago

Hey, thanks, glad you like the project. Creating a PDF file is possible by using the Print page feature of your web browser. I have now added some additional CSS to to improve the design and readability of the printed version. Filtering for a specific chat needs to be done by restricting the SQL query. You only need to add one additional statement to make it work. I have put a hint on what needs to be modified in the README. Most likely, printing (to PDF) will only make sense when you also filter for one or a few chats. Otherwise, the browser will probably get overwhelmed.

You can test this new feature (and find the updated README) on the following branch: https://github.com/chrrel/whatsapp-exporter/tree/feat_print_styles

Buster14 commented 9 months ago

Thanks chrrel! I managed to export it into a single chat, but printing in edge and chrome always crashing the browser, probably cause there's a limit of how big the size of the file. I'm still trying various html to pdf project, will update here as soon as find the one that gives the best result.

chrrel commented 9 months ago

Yeah, this might be a file size issue. I tried it for some of my chats in Firefox and Chromium and it worked even though it took quite some time. Therefore, I will leave this feature as it its now and merge it to the main branch and close this issue.