JSPM

5no-paper-sizes

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q38859F
  • License MIT

Tool for get the paper dimensions

Package Exports

  • 5no-paper-sizes

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (5no-paper-sizes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

5no LogoPaper Sizes

Tool for get the paper dimensions in millimetres, inches, points, pixels

The dimensions of the A, B series paper sizes are defined by the ISO 216 international paper size standard The dimensions of the C series sizes are defined by the ISO 269 paper size standard

Install

@5no/paper-sizes requires Node version 8 or a bove.

npm install --save @5no/paper-sizes

Doc

let options = { 
    dpi: 300, // Dots Per Inch - by default 300
    type: 'mm', // type of measurement 'mm' | 'in' | 'pt' | 'px'
    width: 0, // custom width
    height: 0 // custom height
}

type isoCode = string | null // if you want to make the manual resolution this parameter will be pass null

let data = PaperSizes(isoCode, options)


// convert the width measurement to Millimeters, Inches, Points, Pixels
data.widthToMillimeters() 
data.widthToInches()
data.widthToPoints()
data.widthToPixels()


// convert the height measurement to Millimeters, Inches, Points, Pixels
data.heightToMillimeters()
data.heightToInches()
data.heightToPoints()
data.heightToPixels()

Examples

const PaperSizes = require('5no-paper-sizes')

let data = PaperSizes('A4')

console.log(data.widthToMillimeters(), data.heightToMillimeters())

//210, 297

let one = PaperSizes(null, {
    dpi: 300,
    type: 'px',
    width: 2480,
    height: 3508,
})

console.log(data.widthToMillimeters(), data.heightToMillimeters())

//210, 297

License

MIT Licensed, Copyright (c) 2019 Aleksandr Sokol