Now I'm going to write a code that will change current plot device of the drawing and there isn't a problem here:
acPlSetVdr.SetPlotConfigurationName(acPlSet, newPrinter, "A4");
But how can I leave default paper size not "A4"? For example if there is "A3" it should stay "A3". Because if I go through each drawing I don't know what is the current paper size I just need to change the plot device becuse default has been crashed for example. But if I write "A4" each drawing will have "A4".
Hope I explain everything clearly. Thanx for suggestions.
The way to do this might depend on printer type etc.
1: If possible create two PC3 for one printer, one configured for A4 and one for A3.
2. you might change youre local printer calling printui.dll like this
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "rundll32.EXE";
startInfo.Arguments = "Printui.dll,PrintUIEntry /ia /K /q /m "SHARP MX-5500N PS" /h "Windows NT x86" /v 3 /f sn0hwenu.inf";
//.WshShell shell = new IWshRuntimeLibrary.WshShell();
//string command = "RUNDLL32 PRINTUI.DLL,PrintUIEntry /k /n \"" + printerInfo.PrinterName + "\"";
//object windowStyle = null;
//object waitOnReturn = null;
//shell.Run(command, ref windowStyle, ref waitOnReturn);
3. configure youre default printer with the required papersize, then export these settings
rundll32 printui.dll,PrintUIEntry /Ss /n "ThePrinter" /a "C:\temp\ThePrinter_A4.dat" 9
and import these settings with
rundll32 printui.dll,PrintUIEntry /Sr /n "ThePrinter" /a "C:\temp\ThePrinter_A4.dat" 9
Set default printer: rundll32 printui.dll,PrintUIEntry /y /n "ThePrinter"
4. change registry, see
settings might be exported and imported using DOS cmd
C:\WINNT\system32\reg.exe import c:\temp\ThePrinter_A4.reg
These articles may give you some background.
changing printing preferences
Set+Get Default printer via registry
Access a broad range of knowledge to help get the most out of your products and services.