How to set bottom and top margin for addHTML
See original GitHub issueHi,
I am not able to add margin to top and bottom for multiple pages. How can i add that?
Below code represents:
`
exportAsPdf() {
self = this;
const elementToPrint = document.getElementById('widgets'); //The html element to become a pdf
const pdf = new jsPDF('p', 'pt', 'a4');
pdf.internal.scaleFactor = 2.25;
pdf.text(20, 30, "Dashboard");
let options = {
pagesplit: true,
background: '#fff',
format: 'PNG',
padding: 50,
margin: {
top: 40,
bottom: 30
}
};
let margins = {
top: 40,
bottom: 30
};
//pdf.rect(20, 20, pdf.internal.pageSize.width - 40, doc.internal.pageSize.height - 40, 'S');
// pdf.setDisplayMode("125%", "continuous");
pdf.addHTML(elementToPrint, 0, 30, options, () => {
pdf.save('Dashboard.pdf');
});}
` Please help me out.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12
Top Results From Across the Web
how to set top and bottom margin in addHTML - Stack Overflow
Do it like this: pdf.addHTML(document.getElementById('exportthis'), 5, 10, { pagesplit: true, margin: margins }, function(dispose) { var ...
Read more >How to set bottom and top margin for addHTML #1439 - GitHub
Hi, I am not able to add margin to top and bottom for multiple pages. How can i add that? Below code represents:...
Read more >How To Set Top And Bottom Margin In Addhtml - ADocLib
Setting Custom Margins. Go to Page Layout → Page Setup → Margins → Custom Margins to open the Page Setup box to the...
Read more >CSS Margin - W3Schools
The CSS margin properties are used to create space around elements, outside of any defined borders. ... margin-top; margin-right; margin-bottom; margin-left.
Read more >Add HTML Header or Footer - Encodian Support
Top Margin : Set the top margin value (pt.) The default value is set to 0. Bottom Margin: Set the bottom margin value...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Open your own issue… Is this not clear enough?
Es tut mir leid…