Xojo Print Without Printer 对话框

Xojo Print Without Printer Dialog

我想直接打印到连接的标签打印机而不显示打印对话框。

我已经搜索过这样的事情是否可能,但似乎不可能。所以,我想我会在这里问一下,以防有人知道这样做的方法。

您必须保存打印机设置字符串。然后下次打印时使用该 SetupString 来初始化 PrinterSetup 对象。查看从下面的工作项目复制的实际代码:

 'Now print the mail barcode
  dim ps as PrinterSetup
  dim page as Graphics
  ps = LabelPrinter  //See below 
  if ps<>nil then
    page = OpenPrinter(ps)
    if page<>nil then
      //send stuff to the printer here



Public Function LabelPrinter() as PrinterSetup
  if gLabelSetup<>"" then  //gLabelSetup is saved in preferences
    dim ps as new PrinterSetup
    ps.SetupString = gLabelSetup
    return ps
  else
    return nil
  end if
End Function