jsPDF图像在错误的页面上以错误的顺序显示
jsPDF image keeps displaying in wrong order on wrong page
我正在使用 jsPDF 创建 PDF 下载。
下面是我的代码,它完美地显示了我目前需要的所有信息。
我希望所有内容都按照我有代码的顺序显示在 PDF 上:
- 横幅
- 徽标
- 职位
- 主要内容
除横幅外,一切都在应有的位置。
它一直显示在所有内容的下方。
在输出的 PDF 中,我可以看到 space 在它应该位于顶部的位置,但它总是转到文档的最后一页,在所有其他内容之后。在它显示的页面上,它位于左上角并且宽度和高度正确,因此它正确地执行了此操作,但只是在错误的页面上。
我在这里塞了什么?或者如何强制它位于第 1 页?
在此先感谢您的帮助!
function demoFromHTML() {
var doc = new jsPDF('p', 'mm', 'a4');
var lMargin=20; //left margin in mm
var rMargin=20; //right margin in mm
var pdfInMM=210; // width of A4 in mm
var source = document.getElementById('text-7');
// Banner
html2canvas(jQuery("#top-banner"), {
useCORS : true,
onrendered: function(canvas) {
var banner = canvas.toDataURL('image/png');
doc.addImage(banner, 'PNG', 0, 0, 210, 100);
console.log(banner);
setTimeout(function () {
doc.save('"<?php echo ( get_the_title() );?>"');
}, 0);
}
})
// Logo
var logo = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAC+CAYAAADDYv00AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAGhlJREFUeNrsnc2V28aygMu+3psZGI5AWL6dcCPQePd2giMQHYGgCChFQCkCjiIgJwJKEZDevR3HEfgNjsBjakzOoLur+gf8vnNwfDWXJIDq6vrrPxEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACA3PkPIgAAAENmD9f/PFz1w/W/J3/7P0Sjyw+IAAAi0zxc1XA95stw7RFT0fTO+/XDdXOhnWVo408P1/uH6x6RAQCUkaHNH67Vw/X3yGs7fGeG+Ipz5GuHdj62dY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);
doc.fromHTML(
jQuery('.job_listing-title').get(0), // [Refer Exact code tutorial][2]HTML string or DOM elem ref.
10, // x coord
125, // y coord
{
'width': 190,
});
// Main content
doc.fromHTML(
jQuery('#main').get(0), // [Refer Exact code tutorial][2]HTML string or DOM elem ref.
10, // x coord
135, // y coord
{
'width': 190,
});
}
发帖后才发现原来答案这么简单。
出现此问题是因为我在 html2canvas 中触发了 doc.save,在徽标、职位名称或主要内容之前。相反,我需要将所有其他内容移动到横幅下,但在 doc.save.
之前
下面的程序现在可以正常运行并以正确的顺序和位置输出所有项目。
function demoFromHTML() {
var doc = new jsPDF('p', 'mm', 'a4');
var lMargin=20; //left margin in mm
var rMargin=20; //right margin in mm
var pdfInMM=210; // width of A4 in mm
var source = document.getElementById('text-7');
html2canvas(jQuery("#top-banner"), {
useCORS : true,
onrendered: function(canvas) {
var banner = canvas.toDataURL('image/png');
// Banner
doc.addImage(banner, 'PNG', 0, 0, 210, 100);
// Logo
var logo = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAC+CAYAAADDYv00AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAGhlJREFUeNrsnc2V28aygMu+3psZGI5AWL6dcCPQePd2giMQHYGgCChFQCkCjiIgJwJKEZDevR3HEfgNjsBjakzOoLur+gf8vnNwfDWXJIDq6vrrPxEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACA3PkPIgAAAENmD9f/PFz1w/W/J3/7P0Sjyw+IAAAi0zxc1XA95stw7RFT0fTO+/XDdXOhnWVo408P1/uH6x6RAQCUkaHNH67Vw/X3yGs7fGeG+Ipz5GuHdj62dY3orjdDrwYF6K9fTiLAZuT398PVR4VfT/69KVQG90NWs0Glr4r24Xo16P3sUZb7+eH6mDjT7XX07fCcvvS6/W7I4iBvuqG9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HkDil4M/Jzt2cCAVc2iBsAcOgANowdP/+s4ND3iBsAcOgANs58jGO+P5Oh+6zNZYY7AODQAQx4NfJz57ZTZA06AAAOHTLK0Mdwd+ZvLzzut0fkAAAAujTivnf7KT7bvgIAAIAyY/du3174vs9RkwAAVwEld4iJz97tR3zGz/eIHABw6AD6NCM/twkIBk5hhjsA4NABEjnzSw6dGe4AADh0KDw7983Q94gdAHDoALq8HPm5uwt//8Xxfvc4dADAoQPoMzbDvpShV473+4LIAQCHDqDvzMeOgX8JDAhw6ACAQwdInJ3v5Vup/Byuk+K+InYAwKED6FI5OPRzNB73JEMHABw6gDKhE+J8lqzh0AEAhw6QKEO/VG53HT/fIHIAwKEDpHPol7Jq11PWyM4BAIcOoIxLds2EOAAAgExpJPyoU9dT1irEDgBk6AB54eqc2SEOAHDoAEYZekyHvkHkAIBDB0jHXikguEOUAIBDB0jHpUzc9VAWMnQAwKEDJKZ2cPSXsnyWrAEADh0gMc1IJ3+JW0QIAABgQyvjl5vtzjh4l+VqNeIGAACwy7pdnHI3fK/fTGbr8L01ogYAALCjFveNYXyuFlEDAADYYu3Md4gYAADAHpfSuc91g4gBAADsWRo6c8bOAQAAItEaOnRmtgMAAERiZuTMF4gWAAAgLtpl9524n5MOAAAAgVTKDr1BpAAAAGnohFI7AADAJAgtvS8RIQAAQNlOncwcAAAgMxr5toZ87FrzBpEBAFzmB0QAiakGZ93/9+XJ3/cP11f5diTqHjEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUzv8LMAC5publ4dAlHAAAAABJRU5ErkJggg==';
doc.addImage(logo, 'PNG', 10, 100, 50, 18);
// Job title
doc.setTextColor(0,0,0);
doc.fromHTML(
jQuery('.job_listing-title').get(0), // [Refer Exact code tutorial][2]HTML string or DOM elem ref.
10, // x coord
125, // y coord
{
'width': 190,
});
// Main content
doc.fromHTML(
jQuery('#main').get(0), // [Refer Exact code tutorial][2]HTML string or DOM elem ref.
10, // x coord
135, // y coord
{
'width': 190,
});
console.log(banner);
setTimeout(function () {
doc.save('"<?php echo ( get_the_title() );?>"');
}, 0);
}
})
}
我正在使用 jsPDF 创建 PDF 下载。
下面是我的代码,它完美地显示了我目前需要的所有信息。
我希望所有内容都按照我有代码的顺序显示在 PDF 上:
- 横幅
- 徽标
- 职位
- 主要内容
除横幅外,一切都在应有的位置。 它一直显示在所有内容的下方。
在输出的 PDF 中,我可以看到 space 在它应该位于顶部的位置,但它总是转到文档的最后一页,在所有其他内容之后。在它显示的页面上,它位于左上角并且宽度和高度正确,因此它正确地执行了此操作,但只是在错误的页面上。
我在这里塞了什么?或者如何强制它位于第 1 页?
在此先感谢您的帮助!
function demoFromHTML() {
var doc = new jsPDF('p', 'mm', 'a4');
var lMargin=20; //left margin in mm
var rMargin=20; //right margin in mm
var pdfInMM=210; // width of A4 in mm
var source = document.getElementById('text-7');
// Banner
html2canvas(jQuery("#top-banner"), {
useCORS : true,
onrendered: function(canvas) {
var banner = canvas.toDataURL('image/png');
doc.addImage(banner, 'PNG', 0, 0, 210, 100);
console.log(banner);
setTimeout(function () {
doc.save('"<?php echo ( get_the_title() );?>"');
}, 0);
}
})
// Logo
var logo = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAC+CAYAAADDYv00AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAGhlJREFUeNrsnc2V28aygMu+3psZGI5AWL6dcCPQePd2giMQHYGgCChFQCkCjiIgJwJKEZDevR3HEfgNjsBjakzOoLur+gf8vnNwfDWXJIDq6vrrPxEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACA3PkPIgAAAENmD9f/PFz1w/W/J3/7P0S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AAAAACUzv8LMAC5publ4dAlHAAAAABJRU5ErkJggg==';
doc.addImage(logo, 'PNG', 10, 100, 50, 18);
// Job title
doc.setTextColor(0,0,0);
doc.fromHTML(
jQuery('.job_listing-title').get(0), // [Refer Exact code tutorial][2]HTML string or DOM elem ref.
10, // x coord
125, // y coord
{
'width': 190,
});
// Main content
doc.fromHTML(
jQuery('#main').get(0), // [Refer Exact code tutorial][2]HTML string or DOM elem ref.
10, // x coord
135, // y coord
{
'width': 190,
});
}
发帖后才发现原来答案这么简单。
出现此问题是因为我在 html2canvas 中触发了 doc.save,在徽标、职位名称或主要内容之前。相反,我需要将所有其他内容移动到横幅下,但在 doc.save.
之前下面的程序现在可以正常运行并以正确的顺序和位置输出所有项目。
function demoFromHTML() {
var doc = new jsPDF('p', 'mm', 'a4');
var lMargin=20; //left margin in mm
var rMargin=20; //right margin in mm
var pdfInMM=210; // width of A4 in mm
var source = document.getElementById('text-7');
html2canvas(jQuery("#top-banner"), {
useCORS : true,
onrendered: function(canvas) {
var banner = canvas.toDataURL('image/png');
// Banner
doc.addImage(banner, 'PNG', 0, 0, 210, 100);
// Logo
var logo = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAC+CAYAAADDYv00AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAGhlJREFUeNrsnc2V28aygMu+3psZGI5AWL6dcCPQePd2giMQHYGgCChFQCkCjiIgJwJKEZDevR3HEfgNjsBjakzOoLur+gf8vnNwfDWXJIDq6vrrPxEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACA3PkPIgAAAENmD9f/PFz1w/W/J3/7P0Sjyw+IAAAi0zxc1XA95stw7RFT0fTO+/XDdXOhnWVo408P1/uH6x6RAQCUkaHNH67Vw/X3yGs7fGeG+Ipz5GuHdj62dY3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
doc.fromHTML(
jQuery('.job_listing-title').get(0), // [Refer Exact code tutorial][2]HTML string or DOM elem ref.
10, // x coord
125, // y coord
{
'width': 190,
});
// Main content
doc.fromHTML(
jQuery('#main').get(0), // [Refer Exact code tutorial][2]HTML string or DOM elem ref.
10, // x coord
135, // y coord
{
'width': 190,
});
console.log(banner);
setTimeout(function () {
doc.save('"<?php echo ( get_the_title() );?>"');
}, 0);
}
})
}