Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13,921 changes: 6,961 additions & 6,960 deletions dist/html2pdf.bundle.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/html2pdf.bundle.min.js

Large diffs are not rendered by default.

1,237 changes: 1,217 additions & 20 deletions dist/html2pdf.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/html2pdf.min.js

Large diffs are not rendered by default.

1,230 changes: 1,213 additions & 17 deletions dist/include/html2pdf.es.js

Large diffs are not rendered by default.

1,230 changes: 1,213 additions & 17 deletions dist/require/html2pdf.cjs.js

Large diffs are not rendered by default.

41 changes: 30 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/plugin/pagebreaks.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Worker.prototype.toContainer = function toContainer() {
// Get element position on the screen.
// TODO: Subtract the top of the container from clientRect.top/bottom?
var clientRect = el.getBoundingClientRect();
var scale = self.opt.scale

// Avoid: Check if a break happens mid-element.
if (rules.avoid && !rules.before) {
Expand All @@ -116,7 +117,7 @@ Worker.prototype.toContainer = function toContainer() {
if (rules.before) {
var pad = createElement('div', {style: {
display: 'block',
height: pxPageHeight - (clientRect.top % pxPageHeight) + 'px'
height: (pxPageHeight - (clientRect.top % pxPageHeight)) * scale + 'px'
}});
el.parentNode.insertBefore(pad, el);
}
Expand All @@ -125,7 +126,7 @@ Worker.prototype.toContainer = function toContainer() {
if (rules.after) {
var pad = createElement('div', {style: {
display: 'block',
height: pxPageHeight - (clientRect.bottom % pxPageHeight) + 'px'
height: (pxPageHeight - (clientRect.bottom % pxPageHeight)) * scale + 'px'
}});
el.parentNode.insertBefore(pad, el.nextSibling);
}
Expand Down
3 changes: 2 additions & 1 deletion src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ Worker.template = {
image: { type: 'jpeg', quality: 0.95 },
enableLinks: true,
html2canvas: {},
jsPDF: {}
jsPDF: {},
scale: 1
}
};

Expand Down