|
|
|
|
|
by voiper1
1556 days ago
|
|
I recently went down the PDF rabbit hole for a project. I had to use different OSS tools to do everything I wanted. I was able to access three from within nodejs without touching the disk: 1) Libreoffice CLI for converting doc/docx to PDF. It handled the formatting remarkably well. WARNING: you must have the fonts on the system doing the generating or it will substitute "similar" fonts! NPM: libreoffice-convert 2) NPM pdfjs-dist from mozila for extracting text and finding page numbers. 3) NPM pdf-lib for manipulating PDFs: deleting pages, adding pages from other PDF files (even to the middle of a PDF.) 4) PDF Jam commandline for resizing a pdf `pdfjam --keepinfo --outfile "${path}.resized.pdf" --paper letterpaper "${path}"`; |
|