Can I read PDF or Word Docs with Node.js?

后端 未结 8 2064
不知归路
不知归路 2021-02-02 14:11

I can\'t find any packages to do this. I know PHP has a ton of libraries for PDFs (like http://www.fpdf.org/) but anything for Node?

8条回答
  •  别那么骄傲
    2021-02-02 14:26

    I would suggest looking into unoconv for your initial conversion, this uses LibreOffice or OpenOffice for the actual conversion. Which adds some overhead.

    I'd setup a few workers with all the necessities setup, and use a request/response queue for handling the conversion... (may want to look into kue or zmq)

    In general this is a CPU bound and heavy task that should be offloaded... Pandoc and others specifically mention .docx, not .doc so they may or may not be options as well.


    Note: I know this question is old, just wanted to provide a current answer for others coming across this.

提交回复
热议问题