Skip to content

Commit

Permalink
feat(pdf): center and size at heading
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Sep 24, 2021
1 parent d0cd39c commit 5742513
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/use/pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const usePDF: Callback<any> = () => {
const headingOne = (raw: string) => {
return {
text: raw,
margin: [0, 45],
pageBreak: 'before',
style: 'heading-one',
}
Expand All @@ -26,13 +27,15 @@ export const usePDF: Callback<any> = () => {
const headingTwo = (raw: string) => {
return {
text: raw,
margin: [0, 25],
style: 'heading-two',
}
}

const headingThree = (raw: string) => {
return {
text: raw,
margin: [0, 15],
style: 'heading-three',
}
}
Expand Down Expand Up @@ -114,18 +117,25 @@ export const usePDF: Callback<any> = () => {
content: generate().content(store),
styles: {
'heading-three': {
fontSize: 14,
fontSize: 20,
alignment: 'left',
},
'heading-two': {
fontSize: 16,
fontSize: 24,
alignment: 'center',
},
'heading-one': {
fontSize: 18,
fontSize: 30,
alignment: 'center',
bold: true,
},
paragraph: {
fontSize: 10,
alignment: 'justify',
},
defaultStyle: {
fontSize: 12,
},
},
pageBreakBefore: function (
currentNode: any,
Expand Down

0 comments on commit 5742513

Please sign in to comment.