bepaald / signalbackup-tools

Tool to work with Signal Backup files.
GNU General Public License v3.0
790 stars 38 forks source link

export to pdf (directly) #119

Closed Meteor0id closed 1 year ago

Meteor0id commented 1 year ago

Wonder if it would be possible to export to pdf witjout exporting to hrml. (Posibly generate html then directly print to pdf and not save the html). No clue if that's possible.

bepaald commented 1 year ago

I do not think this is feasible in the foreseeable future. There are of course many, many libraries for generating pdf, but:

  1. it would mean depending on another library, which I have tried very hard to avoid. If I did this, the choice of library would be very limited to ones that are not too big and which I can easily cross-compile to provide the Windows binaries like I do now. Something like libharu would probably work
  2. But that would mean another very complicated output format. I'm having enough trouble as it is just getting the HTML up to snuff, and maintaining it is probably going to be a lot of work.
  3. If I don't want to rewrite the conversion, and use the existing html output, that would save a ton of extra work. But any library that could do this (I know only of wkhtmltopdf), would need to include a HTML rendering engine (like webkit) on top of the pdf engine. This makes the library much too big to simply include (plus, I can't cross-compile wkhtmltopdf for Windows).

So: not at this time. You could probably script something together quite easily if you install wkhtmltopdf yourself (I haven't tested it btw). And maybe I will think of some option, or an add-on program that could call a user-provided wkhtmltopdf to output to pdf directly (or at least automatically). But not anytime soon.