Hi Experts,
NAV 2009 R2 Classic - LS Retail
I need to add image/picture in Footer in sales receipt.
For that I have added one BLOB field(receiptLogo_Footer) in Hardware profile. Added below code in
99008910 - POS OPOS Utility codeunit in PrintBarCode function
Now when I tried in virtual printer it is working well. i.e. receipt logo –in header & receiptLogo_Footer – in Footer
But in physical printer/POS footer image is printing in both Header & footer. That is not correct
Any help would be very much appreciated..
IF (PrinterSetup[JobPrinterNo].Logo = PrinterSetup[JobPrinterNo].Logo::Download) THEN
PrinterSetup[JobPrinterNo].CALCFIELDS(LogoBitmap_Footer);
IF PrinterSetup[JobPrinterNo].LogoBitmap_Footer.HASVALUE THEN BEGIN
LogoPath_Footer := TEMPORARYPATH(); //LS6.10.00.01-01
IF LogoPath_Footer <> '' THEN BEGIN
LogoPath_Footer := LogoPath_Footer + '\bmpexp.bmp';
//LS6.10.00.01-01 -
BLOBRef.Blob := PrinterSetup[JobPrinterNo].LogoBitmap_Footer;
RBAutoMgt.BLOBExport(BLOBRef, LogoPath_Footer, FALSE);
//LS6.10.00.01-01 +
SetBitMap(PTR_S_RECEIPT,LogoPath_Footer);
END;
PrintBitMap;
END;
Or If is there any otherway to add image in Footer in Sales Receipt..
Thanks
Sam
“Any fool can know. The point is to understand.”
― Albert Einstein
0
Answers
Header Logo is printed through function StartPrintjob.
You can add code to function EndPrintJob.
Another option is to make a new function for printing the logo footer and call the function from the codeunit POS Print Utility procedure PrintFooter.
Thank you for the reply
Code is working in virtual printer when i added code in function Endprintjob
But same issue happened.I.e footer logo printing in both header & footer.. in physical printer
Please let know the function/example if which I can call from POS print utility for printfooter
― Albert Einstein
You can try the following (I'm not entirely sure it will work):
Add new constant PTR_S_RECEIPT_F := 3;
//OPOS Printer constants
PTR_S_JOURNAL := 1;
PTR_S_RECEIPT := 2;
//New Line
PTR_S_RECEIPT_F := 3;
//New Line
In your code call SetBitMap with new constant:
SetBitMap(PTR_S_RECEIPT_F,LogoPath);
Create and call new function for printing Footer logo with new constant:
PrintBitMapFooter() : Boolean
//PrintBitMap
IF JobPrinterNo = 0 THEN
EXIT(TRUE);
IF NOT PrinterOpened[JobPrinterNo] OR (JobStation = 0) THEN
EXIT(TRUE);
IF JobStation <> PTR_S_RECEIPT_F THEN
EXIT;
OlePrinter[JobPrinterNo].BinaryConversion := 0;
IF (PrinterSetup[JobPrinterNo].Logo = PosSetup.Logo::"EPSON Flash") THEN BEGIN
OlePrinter[JobPrinterNo].DirectIO(PTR_DI_SET_BITMAP_MODE,PTR_DI_BMP_DOWNLOAD,TmpTxt);
Chr:=28; TmpTxt:=FORMAT(Chr)+'p'; Chr:=1; TmpTxt+=FORMAT(Chr)+'0';
CASE PrinterSetup[JobPrinterNo]."Logo Align" OF
PosSetup."Logo Align"::Center : TmpTxt := ESC+'|cA' + TmpTxt;
PosSetup."Logo Align"::Right : TmpTxt := ESC+'|rA' + TmpTxt;
END;
OlePrinter[JobPrinterNo].PrintNormal(PTR_S_RECEIPT_F,TmpTxt);
END ELSE
OlePrinter[JobPrinterNo].PrintNormal(PTR_S_RECEIPT_F,ESC + '|1B');
IF PrinterSetup[JobPrinterNo]."Print Bin. Conversion" THEN
OlePrinter[JobPrinterNo].BinaryConversion := 1;
In that way only the bitmap added with PTR_S_RECEIPT_F constant should be printed.