|
@@ -184,9 +184,9 @@ export const newHdPrint = function (printerType, type, url, params, fileName, ca
|
|
|
params.type = printerType
|
|
|
}
|
|
|
|
|
|
- if (type == 'preview' && printerType == 'NEEDLE') {
|
|
|
- params.type = 'INK'
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
url(params).then(res => {
|
|
|
if (res.type == 'application/json') {
|
|
|
var reader = new FileReader()
|
|
@@ -215,7 +215,7 @@ export const newJGPrint = function (data, type, printerType) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if (printerType == 'NEEDLE' && type=="print") {
|
|
|
+ if (printerType == 'NEEDLE') {
|
|
|
const LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'))
|
|
|
if (!LODOP) {
|
|
|
confirm({
|
|
@@ -230,19 +230,20 @@ export const newJGPrint = function (data, type, printerType) {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- const dlen = data.data.length
|
|
|
- if(dlen){
|
|
|
- LODOP.SET_SHOW_MODE("HIDE_PBUTTIN_PREVIEW",1);
|
|
|
-
|
|
|
- LODOP.SET_SHOW_MODE('HIDE_PAPER_BOARD', 1)
|
|
|
- LODOP.SET_PRINT_STYLEA(0,"PDFScalMode",1);
|
|
|
-
|
|
|
+
|
|
|
+ if (type == 'preview') {
|
|
|
+ LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', data.data[0])
|
|
|
+ LODOP.SET_PRINT_PAGESIZE(3,2090,0,"");
|
|
|
+ LODOP.PREVIEW()
|
|
|
+ } else if (type == 'print') {
|
|
|
+ const dlen = data.data.length
|
|
|
for(let i=0;i<dlen;i++){
|
|
|
LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', data.data[i])
|
|
|
LODOP.SET_PRINT_PAGESIZE(3, 2090, 0, '')
|
|
|
LODOP.PRINT()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
} else {
|
|
|
|
|
|
const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
|