pdfmake icon indicating copy to clipboard operation
pdfmake copied to clipboard

Add border globally in pdf pages

Open kumarandena opened this issue 7 years ago • 3 comments

Problem - No clear way to add borders around the pages(including header, body, and footer).

Referred - https://github.com/bpampuch/pdfmake/issues/1396#issuecomment-398047057

Expected - Can add borders around the page in pdf. It would be helpful If we have direct option to set border of the page instead of any hacky way.

withborder

Thanks!

kumarandena avatar Feb 11 '19 14:02 kumarandena

var dd = { content: [ { table: { margin:[-40,-40,0], widths: [''], height: [''], bold:'true', body: [ [ //WRITE YOUR CODE FROM HERE //this column is to show how it works { alignment: 'justify', columns: [ { text: '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'

			},
			{
			text:''
			    
			}
		]
	},

  ]
]

} }

]

}

AnuradhaSharma000111 avatar Feb 20 '19 12:02 AnuradhaSharma000111

// playground requires you to assign document definition to a variable called dd

var dd = { content: [ { table: { widths: [''], height: [''], body: [ [ { table: { widths: [''], height: [''], bold:'true', body: [ [

    //WRITE YOUR CODE FROM HERE

{ alignment: 'justify', columns: [ { text: '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'

			},
			{
			text:''
			    
			}
		]
	},

  ]
]

} } ] ] } }

]

}

//[Page with double border.pdf] //(https://github.com/bpampuch/pdfmake/files/2884559/Page.with.double.border.pdf)

AnuradhaSharma000111 avatar Feb 20 '19 12:02 AnuradhaSharma000111

var dd = { background: function (currentPage, pageSize) { return { table: { widths: [pageSize.width - 30], heights: [pageSize.height - 30], body: [['']] }, margin: 10 }; }, }

////This will make a single line border in your pdf docs.///

bibinbiju avatar Feb 03 '21 04:02 bibinbiju