I have a VB.NET module that prints out a series of Crystal and PDF documents as a packet. I need a way to temporarily change the user's default printer to the network printer for the PDF report (the Crystal reports are already redirected). Once the module has done its job, I want the module to return the default printer back to its original setting. Since Adobe Reader only works with the default printer, and there does not appear to be a way to redirect that, I need to change the deault for the duration of the module. I tried the following code, but it still sends the PDF output to the local printer.[code]...
I need to print the contents of 3 textboxs to default printer. what examples I have found dont seem to work. I was trying the documentprint1 component as i thought it would be easy but cant figure out how to tell it what to print the second part is to print a variable (string) to the printer as well.no need for user to select just straight to default printer with its default settings
I have a vb.net app that uses PrintPreviewDialog to print a document. Now I want the user to be able to print to any printer on the network. So, I created a listbox of available printers which works fine. Now, I need to either change the windows default printer to the one selected, or make the PrintPreviewDialog use that printer name.
If this were a Windows forms project I have used the System.Drawing.Printing namespace to accomplish my goal. However, I cannot import this namespace into a Class library.Overall here is what I am trying to do:I am trying to set the default printer using this namespace on both Windows XP and Windows 7 workstations. I am using Visual Basic 2008. My ultimate goal is to create a COM dll which is accessed from an older VBA program. The COM Dll will set the default printer to a new printer. Execution will return to the VBA program and it will print a Crystal Report. When the Crystal report is finished the VBA code will use the COM Dll one last time to set the default printer back to the original default Printer.But as I mentioned I cannot import the namespace I want to use into a Class library. Can someone give me some guidance on how to either import the namespace into a Class Library or how to determine the Default printer name and to set the Default printer to a different value?
Update: I was able to add the Imports Namespace after I added a reference to the correct DLL in Project Properties. My project is targeted at the 3.5 .Net Framework. The System.Drawing.Printing DLL is not in the 3.5 framework. That DLL is in the 2.0.50727 framework. After browsing and Adding that DLL, everything is working fine.BUT this leads to a new question. How would determining the default Printer be accomplished in the 3.5 .Net framework?Secondly, am I asking for trouble having a project target the 3.5 framework AND including a 2.0.50727 component in the same project?
What i want to do is simple but at the same time complicated. I have multiple .PDF file and i want to print them all. Thing is, all the .PDF are in 8,5 X 11 paper size. The printer is also on this paper size by default and i want to print them in a different size. I want to change the default printer size programatically so it prints in the right format. I need to change this in the program because i need to print in a few different paper size.
here is some code
Dim Process1 As New Process Dim starter As New ProcessStartInfo("C:Program FilesAdobeReader 10.0ReaderAcroRd32.exe", "/t " + path + filename + " " + printername + "")
I'm currently pulling HTML data from a database and displaying it in a WebBrowser control in my VB.Net application so that it's correctly rendered. The next step is to print it, but I need to be able to send it to a specific printer rather than the default printer. How can I accomplish this?
I'm currently pulling HTML data from a database and displaying it in a WebBrowser control in my VB.Net application so that it's correctly rendered. The next step is to print it, but I need to be able to send it to a specific printer rather than the default printer.
I want to print an array WebBrowser each time to a different printer without changing the default Printer (not to use the SetDefaultPrinter function) I tried to work with the PrintDocument object(he have the Print function and also i can choose a printer name) but I cant attach the
Renders my control on the page within the markup of the parent document (in this case it's called newSale.aspx)In the code behind in newSale.aspx.vb I need to be able to programmtically change the value of the Controls customerID attribute. I can't seem to do it.This is what I have done, following various Googling attempts, but it is always leaving the customerID as zero
Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Init customerForm1.customerID = "0" '// default Customer ID if no invoice number If Request.QueryString("invno") <> "" Then
For my current application development I need direct printing technique,For the purpose I refer Microsoft Support page Titled"How to send raw data to a printer using VB.Net "The code snippnet specified is perfect for my application.Refers link [URL]But I need something more like Setting the Printer font to Condensed.By default my printer use the font 10cpi ,by using this font size I limited to print only 80char on A4 sheet,but I have more than 80 char on line so I prefer Condensed font size.
I'd like to be able to specify two different printers for two different jobs. I'm using the following class to handle printing these, but regardless of what I do, the default printer is always the one that's printed to.[code]If I inspect my PrinterSettings attribute immediately before the call to DrawString, the PrinterName attribute is still correctly set to the printer I specify, but it's still the default printer that kicks out the job.
i am using Visual Basic.net 2008 and I need a way to print the web brower to the default printer. Now I have worked with printing set pixel ranges but big problems happen when a printer dialog box appears over the space of the webbrowser and gets printed! Could someone give me the general approach, sudo code?
I have a label printer with the driver loaded with the settings in the driver set I can print the exact label that I want, I have the problem that I need to set the default settings in the driver when the software starts. there are 6 of these printers and the only problem we have found is that different operators like to change the settings.
What I need to do is to set the following commands in the driver so each time the system is started (daily) it loads the settings and works properly.
I need to set
Custom Commands Text, Start, Parsed Text
In the Advanced Setup, turn on use printer settings
Other settings would be usfull but as I cannot set these I do not think I will be able to set others.
I have a combo box that contains installed printers on my system, a combo box that has the text file I want to print, and a print button I have created. I am trying to find an understandable way to select the file I want to print, then select the printer I want it to print from, and be able to click the print button.
I have a WebBrowser control in a VB.NET WinForms app. I am able to set the default printer from code and print without prompting the user. However, there is also a print button that shows the PrintDialog. If this action is done first the page will print.Then if I try to programmatically print later (again setting the default printer to some other printer) the it will print to the last printer selected in the PrintDialog box even though I am resetting the default and see the default printer being changed in Windows.It works fine unless ShowPrintDialog has a printer chosen first. Once that occurs it seems to always use that printer no matter what I do.
For Each strPrinter In PrinterSettings.InstalledPrinters If strPrinter.Contains("My Printer") Then wScript.SetDefaultPrinter(strPrinter)
My objective: Set the printer to use without changing the default in Word under the control of vb.net express 08. Word version is 2000
I have it working, butï¿½ Through a lot of trying, I discovered that the WordBasic line would work. Further exploration revealed the ï¿½with dialogs(13)ï¿½ will work. In a Word macro it would be Dialogs(wdFilePrintSetup) or Dialogs(97)
This is where it gets interesting. While Word.WdWordDialog.wdDialogFilePrintSetup equals to 97 it doesnï¿½t activate the correct dialog. After considerable trying, I found that index 13 does yield the correct dialog box.
I managed to print in landscape, however this setting is not being passed onto the printer driver, and when I click on 'preferences' in the printing dialog the printer seems to think that it is printing in portrait. Is there a way to change this in the code, without having to ask the user to do it?
I try to change some printer settings using the win32 api OpenPrinter,GetPrinter and SetPrinter in VB.Net application.I copied most of the code from this or related newsgroups. However, OpenPrinter, GetPrinter and ClosePrinter works so far but I cannot change the printer settings. SetPrinter returns the error code ACCESS DENIED. I know I have to deal with the desired access mask in the _DEFAULT_PRINTER structure when calling OpenPrinter. Unfortunaltely the declaration of the DEFAULT_PRINTER structure or class I found on the internet doesn't work with the OpenPrinter function.
Public Structure DEVMODE Public dmDeviceName As String Dim dmSpecVersion As Short[code]]..........
I would like to change the output file path of the Adobe PDF Printer via code. Currently I am setting the destination path using the Adobe PDF preferences which works fine, however if I change the path in my program I have to go back to the Adobe printer and manually set the new path. How can I change the Adobe output file path via code?
I'm looking for a little assistance in creating a network printer. I will have all the information required to create it, but I'm not sure where to start looking. I just need to create a printer in the current session of the user running my program.