Using Printer Form programmatically

  • Thread starter Thread starter Alphonse
  • Start date Start date
A

Alphonse

Hi,
If I check the printers & faxes ->file ->server properties
There are lot of forms (Envelope, letter, etc).
I could add my custom form too, in this case I add a custom form, named
"MyCustomForm"

This is my code:
Dim pdoc As New PrintDocument

For Each obj As PaperSize In pdoc.PrinterSettings.PaperSizes
MsgBox(obj.PaperName)
Next

This code, only shows some of the forms, not all of the forms. It only
shows letter, tabloid, legal, A3, A4, A5, B4 (JIS), B5 (JIS), Japanese
PostCard & Custom Size.

My question is, how to use MyCustomForm that I've added?
Thx

Regards,

Alphonsus Eka
 
Finally found out, that each of printers have their own forms. Thats
why MyCustomForm doesn't show.
So I need to configure the printer first, then select the form.
Now I could add my custom form to a spesific printer programmatically,
Use the form, then print it. But it works only with dot matrix printer.
In some printer like HP laser jet, I could add the custom form, but I
couldn't use the form. Cause when I'm using this code:

For Each obj As PaperSize In pdoc.PrinterSettings.PaperSizes
MsgBox(obj.PaperName)
Next

It doesn't show my custom form. Looks like it depend on the paper
dimension. If the dimension isn't supported by the printer, it still
added in the list of printer forms, but you can't get it with .Net

Thats my opinion, I would glad if there is any correction. Thx, hope it
helps

Regards,

Alphonsus Eka
 
Back
Top