PB中打印相关(国外英文资料).docVIP

  • 32
  • 0
  • 约1.6万字
  • 约 23页
  • 2017-06-10 发布于河南
  • 举报
PB中打印相关(国外英文资料)

PB中打印相关(国外英文资料) PB in printing -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - select printer -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - On the users requirements, we will encounter such problems in a PC to connect two printers, a print receipts, a printed report, two kinds of printers, paper size and direction of print Settings are not the same, if every switch allows users to manually set, too complicated, the user cant accept it. So we have to control the automatic switch printer in the program. Windows provides good printer related API function, in this I dont have the encapsulation, but with an online user object has been packaged, now lets see how to implement this function. The idea is that a printer is set up by default, save the default printer Settings when switching, and switch when appropriate. Procedure is as follows: Write a function that calls wf_set_printer (string as_oper) return Boolean Any ls_para String ls_driver, ls_our_driver, ls_port, ls_PBPrinter, ls_inifile The Integer li_i, li_count, li_size, li_length, li_row If as_oper = xp then / / set the ticket printer Ls_IniFile = c: \ schinf.ini / / save the.ini file name of the printer to be switched. The format is as follows / / / printer / / Drivers = EPSON TM - U210A Partial cut / / report = Epson lq-1600kiii (default printer) Ls_our_driver = ProfileString (ls_inifile, printer, Drivers, None) If ls_our_driver = None then return false / / a list of printers Li_count = lnv_printer. Of_GetPrinterList (is_list) / / PB default printer Ls_PBPrinter = lnv_printer. Of_GetPBPrinter () / / save the default Lnv_printer. Of_GetPaperSize (ls_pbprinter, ii_size, ii_width, ii_length) Is_para = lnv_printer. Of_getpaperorientation (ls_pbprinter) / / traversing all the printer names that the system installs, if you find the printer to set, set the default, to the purpose of the switch For li_i = 1 To l

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档