@5no/paper-sizes 中文文档教程
Paper Sizes
以毫米、英寸、点、像素为单位获取纸张尺寸的工具
A、B 系列纸张尺寸的尺寸由 ISO 216 国际纸张尺寸标准定义 C 系列尺寸的尺寸由 ISO 269 纸张尺寸标准定义
Install
@5no/paper-sizes 需要 Node 版本 8 或更高版本。
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 许可,版权所有 (c) 2019 Aleksandr Sokol
Paper 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
更多
你可能也喜欢
- 5ug-signlar 中文文档教程
- @0x-lerna-fork/create 中文文档教程
- @10pearls/react-d3-tree 中文文档教程
- @36node-lecha/chat-sdk-js 中文文档教程
- @3test/wanchain-order-gateway 中文文档教程
- @5no/router 中文文档教程
- @6river/loopback2-component-pubsub 中文文档教程
- @90poe/jest-performant-warnings-stats-reporter 中文文档教程
- @a7/rsvg 中文文档教程
- @aarondewes/wp-jest-preset-default 中文文档教程