styled-pdf
v1.0.9
Published
STYLED-PDF is an interactive pdf layout building library, with dev experience similar to css.
Downloads
2
Maintainers
Readme
STYLED-PDF
STYLED-PDF is an interactive pdf layout building library, with dev experience similar to css
STYLED-PDF is an interactive pdf layout building library, with dev experience similar to css.
See an amazing example:
let style = {
marginTop: '10%',
marginLeft: '2%',
...
}
container.dv(style)
- install:
npm i styled-pdf
- importing
import { Container, doc } from "styled-pdf";
const container = new Container()
- Component
- Style
- Javascript function
Features
Component class : At the moment we have 7 components, they are:
DIV
let style = {
marginLeft: '45.5%',
width: '35%',
heigth: '13%',
padding: '15%',
border: [0,0,0],
}
container.div(style)
let style = {
marginLeft: '2%',
width: '14.3%',
heigth: '36%',
padding: '4%',
border: [0,0,0],
bgColor: [201, 201, 201],
}
container.th(style)
let style = {
marginLeft: '2%',
width: '14.3%',
heigth: '38.9%',
padding: '4%',
border: [0,0,0]
}
container.td(style)
let style = {
marginTop: '40.5%',
marginLeft: '4%',
fontSize: 8,
fontWeigth: 'normal'
}
container.p(text, style)
let style = {
top: "20%",
marginLeft: "2%",
marginRight: '4%',
bottom: "30%",
}
container.hr(style)
let style = {
marginTop: "2%",
width: "25%",
height: "20%",
marginLeft: "3%",
};
container.Image(imgBlob, style);