styled-pdf

1.0.9 • Public • Published

STYLED-PDF

STYLED-PDF is an interactive pdf layout building library, with dev experience similar to css

Build Status

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)

First Steps

  • 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

div component
let style = {
            marginLeft: '45.5%',
            width: '35%',
            heigth: '13%',
            padding: '15%',
            border: [0,0,0],
     }
     container.div(style)
TH
th component
let style = {
            marginLeft: '2%',
            width: '14.3%',
            heigth: '36%',
            padding: '4%',
            border: [0,0,0],
            bgColor: [201, 201, 201],
     }
     container.th(style)
TD
td component
let style = {
             marginLeft: '2%',
			width: '14.3%',
			heigth: '38.9%',
			padding: '4%',
			border: [0,0,0]
     }
     container.td(style)
P
p component
let style = {
            marginTop: '40.5%',
            marginLeft: '4%',
            fontSize: 8,
            fontWeigth: 'normal'
     }
     container.p(text, style)
HR
hr component
let style = {
            top:  "20%",
           marginLeft: "2%",
           marginRight: '4%',
           bottom:  "30%",
     }
     container.hr(style)
IMAGE
div component
let style = {
    marginTop: "2%",
    width: "25%",
    height: "20%",
    marginLeft: "3%",
  };
  container.Image(imgBlob, style);

Package Sidebar

Install

npm i styled-pdf

Weekly Downloads

1

Version

1.0.9

License

MIT

Unpacked Size

7.93 kB

Total Files

4

Last publish

Collaborators

  • matondopedro