POS receipt report using c# complete: Error the network name cannot be found
HTML-код
- Опубликовано: 10 ноя 2024
- This video is part of previous lecture • POS receipt report usi...
Below link can be used to find code used
www.techsapphir...
Here solution to error network name cannot be found error is fixed while printing POS reports
Thanks, I was able to get it to work with minor modifications!
thank you.
I have AOE mini thermal printer. will this code work with that
Hi, I try your PrinterUtility NutGet work great for 32bits application. But my application build on 32 and 64bits on Visual Studio 2015. Do you have 64bit version? Can I have the source code or buy from you?
yes please, kindly reach me at yogesh.mehla@gmail.com
@@techsapphire I had some error too. My application build on 32 and 64 bits.
Hi Sir is there a function that I could check the status of the printer? Eg. out of paper / offline / etc. Upon checking and debugging the code "OpenPrinter" function always return = TRUE even the printer is not power ON. please sir email for the response on.
Nick Marquez have you resolved this
Hi sorry, I missed this comment. You can query list of printers and check whether it contains your printer. If not, than it is not online. System.Drawing.Printing.PrinterSettings.InstalledPrinters
Hi, You can query list of printers and
check whether it contains your printer. If not, than it is not online.
System.Drawing.Printing.PrinterSettings.InstalledPrinters
is this possible to print through the internet for Epson-TM-T88VI?
kindly check ruclips.net/video/MQMD4Pb7jzY/видео.html
through cloud@@techsapphire
Code128 not accepting the http link or the text form of data. Do we need to create own code for the same and if yes, if i create the own barcode and convert into byte[] then will it print?
Use code39 public byte[] Code39(string code)
{
int height = 300;
var command = new List {0x1D, 0x68, (byte)height, 0x1D, 0x77,(byte)2,0x1D, 0x6B, 0x45, (byte)code.Length };
command.AddRange(code.ToCharArray().Select(x => (byte)x));
return command.ToArray();
}
Sir every thing works fine but
when i give command again it giving error
Additional information: The process cannot access the file 'C:\Users\User\Desktop\New folder\Help for pos print\Pos print source code\POSPrintExample\bin\Debug\tmpPrint.print' because it is being used by another process.
try this
public static bool SendValueToPrinter(string szPrinterName, Byte[] BytesValue)
{
Byte[] bytes = BytesValue;
bool bSuccess = false;
// Your unmanaged pointer.
IntPtr pUnmanagedBytes = new IntPtr(0);
int nLength = 0;
nLength = Convert.ToInt32(bytes.Length);
// Read the contents of the file into the array.
// Allocate some unmanaged memory for those bytes.
pUnmanagedBytes = Marshal.AllocCoTaskMem(nLength);
// Copy the managed byte array into the unmanaged array.
Marshal.Copy(bytes, 0, pUnmanagedBytes, nLength);
// Send the unmanaged bytes to the printer.
bSuccess = SendBytesToPrinter(szPrinterName, pUnmanagedBytes, nLength);
// Free the unmanaged memory that you allocated earlier.
Marshal.FreeCoTaskMem(pUnmanagedBytes);
return bSuccess;
}
//RawPrinterHelper.SendValueToPrinter(PrinterName, BytesValue);
Same thing happens to me too
by the way the code worked for me
thanks bro
@@techsapphire thank you so much
Sir I am having an issue. i.e.
When printer is attached, it does not print anything but if printer is not attached it sends document to the printer queue and when printer is attached, the queue empties without printing anything.
I tried using "Microsoft Print to PDF" but it generated an empty file.
Please help me with this issue.
You need actual POS printer to test it. As escpos commands cannot be previewed. Else check ruclips.net/video/osI7P1YdL3o/видео.html
Barcode does not print with this. Could you please let us know a workaround
my epson TM-U220 printer prints but it doesn't apply any styling like fontsize or width or anything.. any idea why it could be ?
it is kitchen printer and it is dot matrix. Its styling char esc codes are different.
@@techsapphire its kitchen printer
@@techsapphire what esc codes should i use
use this reference.epson-biz.com/modules/ref_escpos/index.php?content_id=2
How to print gridview in thermal printer?
Tobby check this lecture of mine. ruclips.net/video/0mC_yvT3abw/видео.html
Thanks for the source code
I have use source code
What happening is its printing once
BUT
when i give command again it giving error
Additional information: The process cannot access the file 'C:\Users\User\Desktop\New folder\Help for pos print\Pos print source code\POSPrintExample\bin\Debug\tmpPrint.print' because it is being used by another process.
Try print with below code, without temp file:
public static bool SendValueToPrinter(string szPrinterName, Byte[] BytesValue)
{
Byte[] bytes = BytesValue;
bool bSuccess = false;
// Your unmanaged pointer.
IntPtr pUnmanagedBytes = new IntPtr(0);
int nLength = 0;
nLength = Convert.ToInt32(bytes.Length);
// Read the contents of the file into the array.
// Allocate some unmanaged memory for those bytes.
pUnmanagedBytes = Marshal.AllocCoTaskMem(nLength);
// Copy the managed byte array into the unmanaged array.
Marshal.Copy(bytes, 0, pUnmanagedBytes, nLength);
// Send the unmanaged bytes to the printer.
bSuccess = SendBytesToPrinter(szPrinterName, pUnmanagedBytes, nLength);
// Free the unmanaged memory that you allocated earlier.
Marshal.FreeCoTaskMem(pUnmanagedBytes);
return bSuccess;
}
//RawPrinterHelper.SendValueToPrinter(PrinterName, BytesValue);