Hi Dears

I want to print text throu a termal printer of embedded device.I implement it's code in c# but it doen't print.please guide me any one that know

the below code lpt dll for printer and Nazanin.ttf is font that i will print my text

my code :

IntPtr dc = CreateDC("ltp.dll", "LTP", null, IntPtr.Zero);
            Graphics g = Graphics.FromHdc(dc);
            
            RectangleF rec=new RectangleF();
            string str = "سلام";
           

            Font font = new Font("Nazanin.ttf", 14f, FontStyle.Bold);
            SizeF stringSize = g.MeasureString(str, font);
            rec.X = 0;
            rec.Y = 0;
            rec.Width = stringSize.Width;
            rec.Height = stringSize.Height;
            g.DrawString(str, font , new SolidBrush(Color.Black),rec);
            g.Dispose();

have you checked these links ......this Link ......and.....this Link ..

have you checked these links ......this Link ......and.....this Link ..

my project in Smart device project in C# and my printer is member of device not independet of it like POS but it's a WebPOS of ingenico co.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.