New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

pdf-typeset

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdf-typeset

提供对PDF文件页面的排版处理

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

pdf-typeset

提供对PDF文件页面的排版处理

npm install pdf-typeset --save

API

toTimes()

@param {path} options.sourcePath 原PDF路径
@param {path} options.outputPath 输出路径
@param {path} options.fillPagePath 填补页面倍数的pdf(取第一页)
@param {number} options.insertIndex 插入空白页的原PDF索引
@param {number} options.times PDF处理页面倍数
@param {function} cb 处理完成后的回调

用空白页或指定PDF的第一页 插入指定页数位置,将PDF处理成多少倍数的页数

const { toTimes } = require('pdf-typeset')

toTimes({
  sourcePath: 'source.pdf', 
  fillPagePath: 'fill.pdf',
  insertIndex: -2,
  times: 5,
}, (data, errMsg) => {
  if (data) fs.writeFileSync(`source-after.pdf`, data)
})

toBook()

@param {path} options.sourcePath 原PDF路径
@param {path} options.outputPath 输出路径
@param {path} options.fillPagePath 填补页面倍数的pdf(取第一页)
@param {number} options.insertIndex 插入空白页的原PDF索引
@param {function} cb 处理完成后的回调

将A4 PDF处理成 书册子A3排版(同时处理4倍页数)

const { toBook } = require('pdf-typeset')

toBook({
  sourcePath: 'source.pdf', 
  insertIndex: -2,
  fillPagePath: 'fill.pdf',
}, (data) => {
  data && fs.writeFileSync(`source-after.pdf`, data)
})

书册子A3排版效果

Keywords

pdf排版

FAQs

Package last updated on 10 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts