import { Pdf } from 'modern-pdf'
const pdf = new Pdf({
// colorSpace: 'cmyk',
pages: [
{
width: 300,
height: 600,
children: [
{
type: 'image',
style: { rotate: 60, width: 50, height: 50 },
src: '/assets/test.jpg',
},
{
type: 'text',
style: { rotate: 40, left: 100, top: 100, fontSize: 20, color: '#FF00FF' },
content: 'test',
},
{
type: 'text',
style: { left: 200, top: 100, width: 100, height: 200, fontSize: 22 },
content: [
{
letterSpacing: 3,
fragments: [
{ content: 'He', color: '#00FF00', fontSize: 12 },
{ content: 'llo', color: '#000000' },
],
},
{ content: ', ', color: '#FF0000' },
{ content: 'World!', color: '#0000FF' },
],
},
],
},
],
})
pdf.save('download.pdf')
generated from qq15725/starter-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
🚀 Generate PDF in a way that describes the DOM.
License
qq15725/modern-pdf
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
Repository files navigation
About
🚀 Generate PDF in a way that describes the DOM.
Topics
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published