Спасибо за то, что рассмотрели мой вопрос: < /p>
Используя этот настройка кода, я могу сгенерировать код Datmatrix для экрана, HTML2PDF () стреляет и открывает экземпляр Acrobat, но страница. это пусто. Вес < /p>
DM Code Output Test
document.body.appendChild(barcode))
// Choose the element id which you want to export.
var element = document.getElementById('div_barcode');
element.style.width = '100px';
element.style.height = '100px';
var opt = {
margin: 0.5,
filename: 'mydmcode.pdf',
image: { type: 'png', quality: 1 },
html2canvas: { scale: 1 },
jsPDF: { unit: 'mm', format: [50,50], orientation: 'landscape', precision: '12' }
};
// choose the element and pass it to html2pdf() function and call the save() on it to save as pdf.
html2pdf().set(opt).from(element).save();
});
});
< /code>
Это 2d JavaScript 2D, который работает < /p>
var stemassno = document.getElementById("stemassno").textContent;
var barcode = document.getElementById("barcode");
JsBarcode(barcode, stemassno, {
height: 20,
width: 2
});
barcode.style.display = "inline";
// Choose the element id which you want to export.
var element = document.getElementById('div_barcode');
element.style.width = '100px';
element.style.height = '50px';
var opt = {
margin: 0.5,
filename: 'myfile.pdf',
image: { type: 'jpeg', quality: 1 },
html2canvas: { scale: 1 },
jsPDF: { unit: 'mm', format: [60,22], orientation: 'landscape', precision: '12' }
};
// choose the element and pass it to html2pdf() function and call the save() on it to save as pdf.
html2pdf().set(opt).from(element).save();
});
Подробнее здесь: https://stackoverflow.com/questions/794 ... blank-page
Печать DataMatrix дает пустую страницу ⇐ Javascript
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Почему мой ответ всегда представляет собой пустую пустую строку? [закрыто]
Anonymous » » в форуме Php - 0 Ответы
- 95 Просмотры
-
Последнее сообщение Anonymous
-