3

我想在 verifone vx520 的打印纸上设置徽标,我应该更改 <*PTRLGO> 值吗?以及如何更改 <*PTRLGO>?我怎样才能把这个标志下载到打印机上?我应该如何调用程序上的徽标?我已经用 c 编写了我的程序。这是我的代码,但它是错误的。我使用 GP 命令打印徽标。

#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);    
}
4

1 回答 1

4

你不应该搞乱*PTRLGO. 相反,请使用“字体工具”从位图生成徽标文件。就是这样:

  1. 打开该工具并转到文件 -> 导入。
  2. 导航到您的 MONOCHROME 位图(520 只有一个单色屏幕,所以这个限制不应该是一个问题)。
  3. 选择“另存为”并将类型更改为“ITP 徽标文件 (*.lgo)”。
  4. 对于“选择打印机”,选择 Verix 37xx 并单击确定。
  5. 请务必记住将新徽标文件下载到终端。

关于 #4 的注意事项:据我所知,3740、3750、3730/510、570 和 520 都使用 37xx 打印包。

现在您已将徽标文件下载到终端的内存中,但终端的打印机有自己的内存,您必须先将其加载到那里,然后才能告诉打印机实际打印它。这是一些应该工作的代码:

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");
}

如果您已正确完成所有操作,您应该能够打印出徽标:

StackOverflow Logo 印在 Vx520 上

于 2015-05-07T17:26:21.357 回答