This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, November 10, 2010 1:21:56 PM(UTC)
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 ?
#2
Posted
:
Thursday, November 11, 2010 12:15:55 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
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)
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)
Groups: Registered, Tech Support
Posts: 1,326
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.