By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,219 Members | 2,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,219 IT Pros & Developers. It's quick & easy.

Changing Default Printer Settings

P: n/a
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.
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
* "Rick R" <No****@whocares.com> scripsit:
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?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

P: n/a
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)

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:Og**************@TK2MSFTNGP10.phx.gbl...
* "Rick R" <No****@whocares.com> scripsit:
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?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #3

P: n/a
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.

"Rick R" <No****@whocares.com> wrote in message
news:ut**************@TK2MSFTNGP12.phx.gbl...
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.

Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.