473,399 Members | 4,254 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Changing Default Printer Settings

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
3 8486
* "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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Umesh | last post by:
Hi all I am trying to change the printer(like paper source ,etc) setting in C#. But i am unable to do it. I am not sure how to do it. should i have to use WIN API like Openprinter , getprinter ,...
0
by: Esmee | last post by:
Hi there, I have created an Access 2002 db which contains several reports. Some reports need to be printed on a Laserjet and others on a Labelprinter. One of my clients wants to be able to print...
0
by: Paul E Collins | last post by:
I am using the IE browser control to print HTML reports from a C# application. I do not know of any way to pass print settings to the control (such as landscape orientation), and cannot prompt the...
0
by: Marco Martin | last post by:
Hi, I'm using a control that can print itself using the default printer. I want to change the default "Print Portrait" to "landscape" just before I call my control.print() method. How can I...
0
by: Anthony Nystrom | last post by:
I am having trouble with changing printer settings before I raise either the pagesetup dialog or the print preview dialog... Changing the printer name is easy, but I am also trying to change the...
2
by: ExitusLSU | last post by:
Is there a way to change the DEFAULT printer settings for an installed printer? I want it to change the printer settings for a specified printer at the whole OS/Windows level, not just for the...
0
by: Richard Caldwell | last post by:
we received a access 97 database that runs on Windows 2000 workstations. Before the program added to the system everything worked correctly on the computers. Reports that were landscape showed...
9
spider1916
by: spider1916 | last post by:
I am using the common dialog control to allow my users to select any printer available to them. The code I am using keeps changing the selected printer to the default printer............I don't...
3
by: brianflannery | last post by:
Greetings all! My problem is this. I've installed a new printer on my computer. This is the "default printer" for access. Now, some of my reports, which were working fine with the old printer,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.