From 5742513ebdfb96a8daffa6f50f65d00272f5264d Mon Sep 17 00:00:00 2001 From: Novout Date: Thu, 23 Sep 2021 22:46:23 -0300 Subject: [PATCH] feat(pdf): center and size at heading --- src/use/pdf.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/use/pdf.ts b/src/use/pdf.ts index c750c05b2..dcf80d675 100644 --- a/src/use/pdf.ts +++ b/src/use/pdf.ts @@ -18,6 +18,7 @@ export const usePDF: Callback = () => { const headingOne = (raw: string) => { return { text: raw, + margin: [0, 45], pageBreak: 'before', style: 'heading-one', } @@ -26,6 +27,7 @@ export const usePDF: Callback = () => { const headingTwo = (raw: string) => { return { text: raw, + margin: [0, 25], style: 'heading-two', } } @@ -33,6 +35,7 @@ export const usePDF: Callback = () => { const headingThree = (raw: string) => { return { text: raw, + margin: [0, 15], style: 'heading-three', } } @@ -114,18 +117,25 @@ export const usePDF: Callback = () => { 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,