不涉及业务,讲一下技术方面PDF生成服务的心得

文档指北:

  • puppeteer(https://github.com/puppeteer/puppeteer)
    Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless by default, but can be configured to run full (non-headless) Chrome or Chromium.
    

应用场景:

  1. 页面截图服务
  2. PDF生成服务
  3. 自动化测试
  4. 服务端渲染内容抓取

try:https://try-puppeteer.appspot.com/

就几乎碰到的问题,文档上面都能找到,所以文档和生态还是比较完备的
https://github.com/puppeteer/puppeteer/blob/main/docs/api.md

也有troubleShooting的文档:
https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md