How to use percollate - 3 common examples

To help you get started, we’ve selected a few percollate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ranshaw / HtmlOrMarkdownConvertedToPdf / index.js View on Github external
const task = schedule.scheduleJob(rule, function () {
      i++
      console.log('i---', i)
      percollate.configure();
      percollate.pdf(arr[i - 1], {
        output: (i - 1) + name,
        css,
        usePup
      });
      if (i === arr.length) {
        i = 0
        // 获得未生成pdf文件的index值
        unsavedFiles = utils.getUnsavedIndex(arr.length)
        return
      }
      // 第一次生成失败的再次生成
      if (unsavedFiles.length) {
        percollate.configure();
        percollate.pdf(arr[unsavedFiles[i - 1]], {
          output: (unsavedFiles[i - 1]) + name,
github ranshaw / HtmlOrMarkdownConvertedToPdf / index.js View on Github external
percollate.configure();
      percollate.pdf(arr[i - 1], {
        output: (i - 1) + name,
        css,
        usePup
      });
      if (i === arr.length) {
        i = 0
        // 获得未生成pdf文件的index值
        unsavedFiles = utils.getUnsavedIndex(arr.length)
        return
      }
      // 第一次生成失败的再次生成
      if (unsavedFiles.length) {
        percollate.configure();
        percollate.pdf(arr[unsavedFiles[i - 1]], {
          output: (unsavedFiles[i - 1]) + name,
          css,
          usePup
        });
      } else {
        utils.mergePdfs(arr.length, '廖雪峰JavaScript全栈教程.pdf')
        task.cancel()
      }
    });
github ranshaw / HtmlOrMarkdownConvertedToPdf / index.js View on Github external
getHtml(pageApi).then(res => {
    const urlList = getUrlList(res, wrapEle, url);
    percollate.configure();
    percollate.pdf(urlList, {
      output: name,
      css,
      usePup
    });
  });
}

percollate

A command-line tool to grab web pages as PDF

MIT
Latest version published 3 months ago

Package Health Score

67 / 100
Full package analysis

Popular percollate functions