Changing Default Printer Settings

R

Rick R

We need to change the paper size for the default printer before printing a
PDF file from within a VB.Net application.

printDocument printerSettings is not appropriate as there is no document to
print.

Any help is greately appreciated.
 
H

Herfried K. Wagner [MVP]

* "Rick R said:
We need to change the paper size for the default printer before printing a
PDF file from within a VB.Net application.

How do you print that file?
 
R

Rick

The file is printed using an Adobe Actobat control dimmed in code. Here is
the snippet.

CType(avDoc, Acrobat.CAcroAVDoc).Open(strFileName, "")

pdDoc = CType(avDoc, Acrobat.CAcroAVDoc).GetPDDoc

nbrPages = CType(pdDoc, Acrobat.CAcroPDDoc).GetNumPages()

CType(avDoc, Acrobat.CAcroAVDoc).PrintPages(0, nbrPages - 1, 1, 1, 1)

CType(avDoc, Acrobat.CAcroAVDoc).Close(0)
 
R

Rick R

Herfried.

Still looking for help setting paper size on a printer. I can zap a byte
in the DevMode reg key for the printer but that's a real hack.

I can set the default printer using ManagementObject and
InvokeMethod("SetDefaultPrinter") to set the printer I wish. However, I
cannot find a way via ManagementObject to set paper size.

Thanks again for any help on this.
 

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