4

I've a application that does some batch printing with the SWT API. For that printing, I've to set programmatically all attributes of the printing configuration. Currently I'm able to set all attributes avaliable at PrinterData class.

The problem is that this class doesn't support setting page size and in various cases I'll have to set it to ISO A5 or A3 format, for example.

My question is: Has anybody found himself in this situation? How to solve it? Is it possible to edit PrinterData.otherData to define this property programmatically or only through a PrinterDialog?

Thanks in advance.

4

2 回答 2

1

这是我发现的:

  1. PrinterData当前无法设置纸张尺寸。是一个错误报告。
  2. 有一个叫做 swt-printdialog-extension的东西,据说它可以让你用 windows 32bit 设置大小。
于 2012-10-26T18:24:51.907 回答
0

到处走走,使用后PrintDialog.open()您可以获取它返回的PrinterData,其中PrinterData.otherData有页面大小。我使用此解决方法让 PaperClips 打印预览按我选择的页面大小显示打印预览

于 2013-02-13T14:39:50.500 回答