Print Image in Footer

suraj92291
Member Posts: 49
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
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
― Albert Einstein
0
Answers
-
Why is code added to function PrintBarCode?
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.
0 -
Hi iglabas,
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“Any fool can know. The point is to understand.”
― Albert Einstein0 -
It seems to me that the problem with the physical printer that the SetBitmap is adding each time a new logo to the queue witch are then all printed in PrintBitMap procedure.
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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions