Set the margin to pdf page
See original GitHub issueI am using jsPDF version 1.5.3 and I want to convert HTML into PDF. I also want to add margin to each pages of PDF so that content should not get cut while splitting it to next page. I have written following code until now:
var pdf = new jsPDF('p', 'pt', 'a4');
var margin = {top: 10, right: 20, bottom: 10, left: 20};
pdf.html(document.getElementById('content'), {
callback : function (pdf) {
pdf.save('content.pdf');
}
});
I have a margin to set, but didn’t find any way to set. Does anyone help me out here?
Issue Analytics
- State:
- Created 5 years ago
- Comments:19
Top Results From Across the Web
How to change Margins in PDF? - Adobe Support Community
It's pretty lame that it's so buried, but you actually can change the margins through the header and footer dialog box. Go under...
Read more >How to Change the Margins on a PDF File - Techwalla
How to Change the Margins on a PDF File · Step 1. Open the file in Adobe Acrobat, then select "Document" and "Crop...
Read more >Resize or add margins on PDF Online For Free using DeftPDF
How to resize PDF pages or Add Page Margins · Select “Add Margins and Padding” to change or add white spaces. You can...
Read more >Show Page Margins in a PDF
Setting Up Your Workstation. Recommended Browser: Google Chrome. Adobe Acrobat DC. 1. It is recommended you configure your browser for .pdfs to open...
Read more >How can I add a margin to all pages of a PDF document?
1 Answer 1 · Open the PDF document you want to add the margin to in Preview. · Go to File -> Print...
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 FreeTop 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
Top GitHub Comments
@pedrovsp
Problem is, that all these things should be concentrated in one issue and not 100 issues of some of the same aspects.
Should this issue really be marked as a duplicate? From I what I understood this issue regards the specific problem of setting margins to PDFs with the .html() method, whereas issue #1176 is a broad discussion on the new .html(). Also, issue #1176 doesn’t seems to have solution nor discussion on this specific problem. Isn’t it better for this issue to stay open until we find a solution and keep the other issue less polluted.