private void SendPrinterSettingCommand() { // 203 DPI : 1mm is about 7.99 dots // 300 DPI : 1mm is about 11.81 dots // 600 DPI : 1mm is about 23.62 dots int dotsPer1mm = (int)Math.Round((float)BXLLApi.GetPrinterDPI() / 25.4f); int nPaper_Width = Convert.ToInt32(91 * dotsPer1mm); int nPaper_Height = Convert.ToInt32(61 * dotsPer1mm); int nMarginX = Convert.ToInt32(3 * dotsPer1mm); int nMarginY = Convert.ToInt32(3 * dotsPer1mm); int nSpeed = (int)SLCS_PRINT_SPEED.PRINTER_SETTING_SPEED; int nDensity = Convert.ToInt32(14); int nOrientation = (int)SLCS_ORIENTATION.TOP2BOTTOM; int nSensorType = (int)SLCS_MEDIA_TYPE.GAP; //if (rdoBmark.Checked) nSensorType = (int)SLCS_MEDIA_TYPE.BLACKMARK; //else if (rdoContinuous.Checked) nSensorType = (int)SLCS_MEDIA_TYPE.CONTINUOUS; // Clear Buffer of Printer BXLLApi.ClearBuffer(); // Rewinder is only available for XT series printers (XT5-40, XT5-43, XT5-46) //if (rdoRewind.Checked) //{ // BXLLApi.PrintDirect("RWDy", true); //} // Set Label and Printer //BXLLApi.SetConfigOfPrinter(BXLLApi.SPEED_50, 17, BXLLApi.TOP, false, 0, true); BXLLApi.SetConfigOfPrinter(nSpeed, nDensity, nOrientation, false, 1, true); // Select international character set and code table.To BXLLApi.SetCharacterset((int)SLCS_INTERNATIONAL_CHARSET.ICS_CHINA, (int)SLCS_CODEPAGE.FCP_CP1252); /* * 1 Inch : 25.4mm * 1 mm : 7.99 Dots (XT5-40, SLP-TX400, SLP-DX420, SLP-DX220, SLP-DL410, SLP-T400, SLP-D420, SLP-D220, SRP-770/770II/770III) * 1 mm : 7.99 Dots (SPP-L310, SPP-L410, SPP-L3000, SPP-L4000) * 1 mm : 7.99 Dots (XD3-40d, XD3-40t, XD5-40d, XD5-40t, XD5-40LCT) * 1 mm : 11.81 Dots (XT5-43, SLP-TX403, SLP-DX423, SLP-DX223, SLP-DL413, SLP-T403, SLP-D423, SLP-D223) * 1 mm : 11.81 Dots (XD5-43d, XD5-43t, XD5-43LCT) * 1 mm : 23.62 Dots (XT5-46) */ BXLLApi.SetPaper(nMarginX, nMarginY, nPaper_Width, nPaper_Height, nSensorType, 0, 2 * dotsPer1mm); // Direct thermal // if (true) BXLLApi.PrintDirect("STd", true); //else // Thermal transfer // BXLLApi.PrintDirect("STt", true); }