Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, November 10, 2010 1:21:56 PM(UTC)

seubi  
seubi

Groups: Registered
Posts: 3


Is it possible to change default paper size to A4, and resolution to 600 dpi.

After calling the method
" public static void Install(PrinterInfo printerInfo); "
the printer is well created using "Letter" format and 150dpi.

But nothings happens in printer properties in windows control panel if I try to change the following properties :
Printer p = new Printer(_printercaption);
p.Specifications.DimensionsInInches = false;
p.Specifications.PaperSizeName = "A4 Sheet";
p.Specifications.PaperHeight = 297;
p.Specifications.PaperWidth = 210;
...

Is there a way to do that ?
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, November 11, 2010 12:15:55 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

You can change the printer specifications (paper size, resolution, etc.) after creating and installing the printer as follows:
+----------------+
private void InstallPrinter()
{
try
{
string printerName = "Test LEADTOOLS Printer";
string printerPassword = "Test Password";
if (Printer.IsLeadtoolsPrinter(printerName))
{
PrinterInfo tmpPrinterInfo = new PrinterInfo();
tmpPrinterInfo.PrinterName = printerName;
tmpPrinterInfo.DriverName = printerName;
Printer.UnInstall(tmpPrinterInfo);
}

PrinterInfo printerInfo = new PrinterInfo();
printerInfo.DriverName = printerName;
printerInfo.ProductName = printerName;
printerInfo.PrinterName = printerName;
printerInfo.Password = printerPassword;
printerInfo.RegistryKey = "LEADTOOLS Test Printer Inc.";
printerInfo.RootDir = @"C:\Program Files\LEAD Technologies\LEADTOOLS 17\Bin\Common\PrinterDriver";
printerInfo.Url = "http://www.Leadtools.com";
printerInfo.PrinterExe = null;
printerInfo.AboutString = "LEADTOOLS Printer";
printerInfo.AboutIcon = null;

Printer.Install(printerInfo);

string strMsg = string.Format("Installion {0} Completed Successfully", printerName);
MessageBox.Show(strMsg, "LEADTOOLS Printer Demo", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (PrinterDriverException ex)
{
MessageBox.Show(string.Format("Other error: Message:{0}", ex.Message));
}
}

Printer TestPrinter;

private void button2_Click(object sender, EventArgs e)
{
TestPrinter = new Printer("Test LEADTOOLS Printer");

InstallPrinter();            

PrinterSpecifications myPrinterSpecifications = new PrinterSpecifications();
myPrinterSpecifications.PaperSizeName = "A4 Sheet";
myPrinterSpecifications.PaperHeight = 297;
myPrinterSpecifications.PaperWidth = 210;
myPrinterSpecifications.DimensionsInInches = false;
myPrinterSpecifications.PortraitOrient = true;
myPrinterSpecifications.MarginsPrinter = "Margins Printer Name";
myPrinterSpecifications.PrintQuality = 600;
myPrinterSpecifications.YResolution = 600;

TestPrinter.Specifications = myPrinterSpecifications;
}
+----------------+

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Thursday, November 11, 2010 5:13:33 AM(UTC)

seubi  
seubi

Groups: Registered
Posts: 3


Ok Thanks for your answer it works.

Is it better to use ?

myPrinterSpecifications.PaperID = Convert.ToInt32(PaperKind.A4);
 
#4 Posted : Thursday, November 11, 2010 7:08:57 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

You can use the PaperID or the PaperSizeName property. The two properties give you the same results.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.150 seconds.