问题
I want to set a logo on printed paper in verifone vx520 should i change the <*PTRLGO> value? and how can i change the <*PTRLGO>? and how can i download this logo to the printer? how should i call the logo on program? I have written my program with c. here is my code but it's wrong. i used GP command to print a logo.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <svc.h>
char myLOGO[]="testlogo.bmp";
char buf[200]="";
void main ()
{
int i,t;
char logo[]="*PTRLGO";
char buf[500] = "";
int prt_handle,prt_com;
prt_handle = open(DEV_CONSOLE, 0);
prt_com = open(DEV_COM4, 0);
put_env(logo,myLOGO,1);
sprintf(buf, "%cGP1;",27);
write(prt_com, buf, strlen(buf));
SVC_WAIT (100);
close(prt_com);
}
回答1:
You shouldn't need to mess around with *PTRLGO
. Instead, use the "Font Tool" to generate a logo file from a bitmap. Here's how:
- Open the tool and go to File -> Import.
- Navigate to your MONOCHROME bitmap (the 520 only has a monochrome screen, so this limitation shouldn't be a concern).
- Choose "Save As" and change the type to "ITP Logo Files (*.lgo)".
- For "Select Printer", choose Verix 37xx and click OK.
- Be sure to remember to download the new logo file to the terminal.
NOTE on #4: The 3740, 3750, 3730/510, 570 and 520 all use the 37xx print pak, as far as I'm aware.
Now you have the logo file downloaded to the TERMINAL'S memory, but the terminal's PRINTER has its own memory, and you have to load it there before you can tell the printer to actually print it. Here's some code that should work:
void PrintLogoToPaper()
{
//open a printer handle and a file handle
//Assume we have already acquired the printer from DevMan if you are using VMAC
int hPrinter = hPrinter = open(DEV_COM4,0);
int h_font_file = open("logo.lgo", O_RDONLY);
//send the logo to the printer's memory
p3700_dnld_graphic_file (hPrinter, h_font_file);
//Now that we have loaded the printer logo to the printer's memory,
// we can tell the printer to actually print it out
p3700_print_graphic(hPrinter, 0, 50);
//remember to close your file and handles
close(h_font_file);
close(hPrinter);
//Not sure why, but if you take this print message out, then the logo
//doesn't always print. Please update if you know a better solution.!
clrscr();
printf("Printing");
}
If you have done everything correctly, you should be able to print the logo out:
来源:https://stackoverflow.com/questions/30092955/how-to-set-logo-on-verifone-vx520-internal-printer