Using Printer Form programmatically


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
 
Ad

Advertisements

A

Alphonse

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top