-
Anonymous
Когда я печатаю выделение после html2pdf, я хочу написать номер страницы в нижнем колонтитуле для каждой страницы.
Сообщение
Anonymous »
Код: Выделить всё
async function generateAndUploadPDF() {
const tableContent = document.getElementById('tableContent');
const opt = {
margin: [5, 10, 5, 10], // Margin in centimeters
filename: 'table.pdf',
image: { type: 'jpeg', quality: 1.0 },
html2canvas: {
useCORS: true,
scrollY: 0,
scale: 3, // Adjust scale as needed to fit content within A4
letterRendering: true,
dpi: 1000,
// width: tableContent.offsetWidth,
allowTaint: false
},
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' },
// pagebreak: { avoid: 'thead, tbody, tr' },
// Add page numbers
callback: function (pdf) {
const totalPages = pdf.internal.getNumberOfPages();
for (let i = 1; i
Подробнее здесь: [url]https://stackoverflow.com/questions/78666533/when-i-print-the-selection-after-html2pdf-i-want-to-write-the-page-number-in-fo[/url]
1719308166
Anonymous
[code]async function generateAndUploadPDF() {
const tableContent = document.getElementById('tableContent');
const opt = {
margin: [5, 10, 5, 10], // Margin in centimeters
filename: 'table.pdf',
image: { type: 'jpeg', quality: 1.0 },
html2canvas: {
useCORS: true,
scrollY: 0,
scale: 3, // Adjust scale as needed to fit content within A4
letterRendering: true,
dpi: 1000,
// width: tableContent.offsetWidth,
allowTaint: false
},
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' },
// pagebreak: { avoid: 'thead, tbody, tr' },
// Add page numbers
callback: function (pdf) {
const totalPages = pdf.internal.getNumberOfPages();
for (let i = 1; i
Подробнее здесь: [url]https://stackoverflow.com/questions/78666533/when-i-print-the-selection-after-html2pdf-i-want-to-write-the-page-number-in-fo[/url]