Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add border globally in pdf pages #1633

Open
kumarandena opened this issue Feb 11, 2019 · 3 comments
Open

Add border globally in pdf pages #1633

kumarandena opened this issue Feb 11, 2019 · 3 comments

Comments

@kumarandena
Copy link

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

Referred - #1396 (comment)

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!

@AnuradhaSharma000111
Copy link

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
Copy link

// 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)

@bibinbiju
Copy link

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.///

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants