0.0.7 • Published 6 years ago

chin-plugin-inkscape v0.0.7

Weekly downloads
10
License
MIT
Repository
github
Last release
6 years ago

chin-plugin-inkscape

npm npm Build Status Coverage Status

chin plugin that operate Inkscape (and PDFtk).

Installation

yarn add -D chin chin-plugin-inkscape

Usage

ref: inkscape options

inkscape(format, options)

import inkscape from 'chin-plugin-inkscape'

const ext = inkscape('png', {
  area,
  dpi,
  width,
  height,
  background,
  backgroundOpacity,

  /* detail setting */
  config: {
    export: { [camelProperty] },
    query: { [camelProperty] },
    [camelProperty]
  }
})

format

valueas
'png'--export-png
'pdf'--export-pdf
'ps'--export-ps
'eps'--export-eps
'plain'--export-plain-svg

area

valueas
'page' default--export-area-page
'drawing'--export-area-drawing
'snap'--export-area-snap
'x0:y0:x1:y1'--export-area=x0:y0:x1:y1

options

  • dpi default: 96

  • width/height overrides the dpi setting

  • background/backgroundOpacity

config

For detail setting that must have all properties as camelCase. Setting true as value means just pass. Properties that belongs to export and query are passed as --export-[property] and --query-[property].

inkscapeMergePdfs(options)

Merge pdf files after process. depending on pdf-merge (using PDFtk).

options is same to above (no need format).

import { inkscapeMergePdfs } from 'chin-plugin-inkscape'

const ext = inkscapeMergePdfs()

export default {
  put: 'put',
  out: 'out',
  processors: { svg: ext },
  after() =>
    ext.after(
      'out/merge.pdf',
      { sort: (filepaths) => filepaths.sort() }
    )
}

ext.after(outpath, options)

Write file that pdfs merged.

  • sort function for sort that pass filepaths

  • noCleanAfter prevent cleaning default: false

License

MIT (http://opensource.org/licenses/MIT)

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago