irelephant 🍭@lemm.ee to Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ@lemmy.dbzer0.comEnglish · 1 个月前How do i turn a collection of xhtml files into a pdf?message-squaremessage-square12fedilinkarrow-up119arrow-down11file-text
arrow-up118arrow-down1message-squareHow do i turn a collection of xhtml files into a pdf?irelephant 🍭@lemm.ee to Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ@lemmy.dbzer0.comEnglish · 1 个月前message-square12fedilinkfile-text
minus-squareirelephant 🍭@lemm.eeOPlinkfedilinkEnglisharrow-up1·1 个月前I made the script to rip them in bash. I know python, lua, js, bash and powershell, anything using these works.
minus-squaredeegeeselinkfedilinkEnglisharrow-up3·1 个月前Surely you can figure out how to use existing libraries for this task, or is there something you’re stuck on?
minus-squareirelephant 🍭@lemm.eeOPlinkfedilinkEnglisharrow-up2·1 个月前Can’t really find many good ones. Google isn’t returning much, just pdfs about python libraries and the odd abandoned github repo
minus-squareDaniel Quinn@lemmy.calinkfedilinkEnglisharrow-up3·1 个月前I’ve used pdfkit to considerable success. It has a few system-level dependencies, but the instructions are pretty straightforward: # apt-get install wkhtmltopdf $ pip install pdfkit
minus-squareCousin Mose@lemmy.hogru.chlinkfedilinkEnglisharrow-up1·edit-21 个月前In a production web app I use Gotenberg. It’s definitely overkill for the task at hand, but if you find yourself doing this often I would highly recommend it. It’s dead easy to convert HTML (and I imagine XHTML) to PDF.
I made the script to rip them in bash. I know python, lua, js, bash and powershell, anything using these works.
Surely you can figure out how to use existing libraries for this task, or is there something you’re stuck on?
Can’t really find many good ones. Google isn’t returning much, just pdfs about python libraries and the odd abandoned github repo
I’d start with wkhtmltopdf/pdfkit
I’ve used pdfkit to considerable success. It has a few system-level dependencies, but the instructions are pretty straightforward:
# apt-get install wkhtmltopdf $ pip install pdfkit
In a production web app I use Gotenberg. It’s definitely overkill for the task at hand, but if you find yourself doing this often I would highly recommend it. It’s dead easy to convert HTML (and I imagine XHTML) to PDF.