Added Dowload feture
This commit is contained in:
parent
aade736b5c
commit
19af706317
|
|
@ -11,6 +11,7 @@ import { PublicQrCodepost } from '../../../../Features/ConfigMasterPage/ConfigMa
|
||||||
import { renderToStaticMarkup } from 'react-dom/server';
|
import { renderToStaticMarkup } from 'react-dom/server';
|
||||||
|
|
||||||
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
||||||
|
const uploadApiUrl = import.meta.env.ENV_IMAGE_UPLOAD_API_URL;
|
||||||
|
|
||||||
// Create a secure blob URL creator that works in all environments
|
// Create a secure blob URL creator that works in all environments
|
||||||
const createSecureBlobUrl = (blob) => {
|
const createSecureBlobUrl = (blob) => {
|
||||||
|
|
@ -60,10 +61,10 @@ export const MobileMultiPdfPrint = async ({
|
||||||
dispatch,
|
dispatch,
|
||||||
UserId = '',
|
UserId = '',
|
||||||
onProgress = () => {},
|
onProgress = () => {},
|
||||||
|
returnBlob = false,
|
||||||
}) => {
|
}) => {
|
||||||
try {
|
try {
|
||||||
const style = await PrintStyleFunction(printerTemplateStyle, 'Sales');
|
const style = await PrintStyleFunction(printerTemplateStyle, 'Sales');
|
||||||
|
|
||||||
const stylesMap = {
|
const stylesMap = {
|
||||||
'Style 1': 'PrintStyle1',
|
'Style 1': 'PrintStyle1',
|
||||||
'Style 2': 'PrintStyle2',
|
'Style 2': 'PrintStyle2',
|
||||||
|
|
@ -170,6 +171,15 @@ export const MobileMultiPdfPrint = async ({
|
||||||
revokeSecureBlobUrl(blobUrl);
|
revokeSecureBlobUrl(blobUrl);
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return blob if requested (after download completes)
|
||||||
|
if (returnBlob && PrintComing === 'download') {
|
||||||
|
setPrintOrderDetails([]);
|
||||||
|
if (container) {
|
||||||
|
document.body.removeChild(container);
|
||||||
|
}
|
||||||
|
return { success: true, pdfBlob: combinedPdfBlob };
|
||||||
|
}
|
||||||
|
|
||||||
// if (PrintComing === "whatsapp") {
|
// if (PrintComing === "whatsapp") {
|
||||||
// const orderIds = PrintOrderDetails.map((row) => row?.OrderId).filter(Boolean);
|
// const orderIds = PrintOrderDetails.map((row) => row?.OrderId).filter(Boolean);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue