I need asp.net print page task, DOT NET Programming

Assignment Help:

I need asp.net print page task

Project Description:

I have a little task on asp.net, I need to print a text data to receipt printer from web page, I used the subsequent code and it works fine on my local machine:

Service service = null;

protected void Page_Load(object sender, EventArgs e)

{

try

{

ServiceFunc serv = new ServiceFunc();

service = serv.GetService(Convert.ToInt32(Session["servid"]));

printpage();

}

catch (Exception ex)

{ }

}

 

public void printpage()

{

PrintDialog pd = new PrintDialog();

PrintDocument pdoc = null;

pdoc = new PrintDocument();

Response.Write("1");

PrinterSettings ps = new PrinterSettings();

Font font = new Font("Courier New", 12);

PaperSize psize = new PaperSize("Custom", 300, 400);

pd.Document = pdoc;

pd.Document.DefaultPageSettings.PaperSize = psize;

pdoc.DefaultPageSettings.PaperSize.Height = 600;

pdoc.DefaultPageSettings.PaperSize.Width = 300;

Response.Write("2");

pdoc.PrintPage += new PrintPageEventHandler(pdoc_PrintPage);

Response.Write("3");

PrintPreviewDialog pp = new PrintPreviewDialog();

pp.Document = pdoc;

Response.Write("4");

pdoc.Print();

Response.Write("5");

}

void pdoc_PrintPage(object sender, PrintPageEventArgs e)

{

Graphics graphics = e.Graphics;

Font font = new Font("Courier New", 10);

graphics.DrawString("XXX", new Font("Courier New", 9), new SolidBrush(Color.Black), startX, startY + Offset);

}

if you have a solution or another way to print.

Skills required are .NET, ASP, Print, C# Programming


Related Discussions:- I need asp.net print page task

Different types of replication supported by sql server, What are the differ...

What are the different types of replication supported by SQL SERVER? There are 3  types of replication supported by SQL SERVER which are shown below:- 1) Snapshot Replicati

How does output caching work in asp.net, How does output caching work in AS...

How does output caching work in ASP.NET?    Output caching is a powerful method that enhances request/response throughput by caching the content generated from dynamic pages. O

We''re seeking an it candidate, Project Description: We're seeking an IT...

Project Description: We're seeking an IT candidate with experience to help us optimizely,  Skills required: .NET, C# Programming, ASP, eCommerce, SQL

It systems analyst, Project Description: Someone to review all our IT sy...

Project Description: Someone to review all our IT systems / dfs replication / set up/ backups etc and give a report. Skills required: SQL, Microsoft Exchange, Windows Serv

Define inheritance, Can you define what inheritance is and an example of wh...

Can you define what inheritance is and an example of when you might use it? The process of deriving a new class from an existing class is known as Inheritance. The old class is

Develop membership plans in asp.net, First let me start by saying that I ha...

First let me start by saying that I have been writing code for almost 25 years. So I am only looking for someone to assist advance a project I am working on. Someone that is unders

What is code access security, What is code access security (CAS)? Code ...

What is code access security (CAS)? Code access security (CAS) is part of the .NET security model that stops unauthorized access of resources and operations, and restricts the

#title., what are major difference between classic ADO &ADO.NET?

what are major difference between classic ADO &ADO.NET?

Different types of joins, What are the different types of joins? 1) IN...

What are the different types of joins? 1) INNER JOIN: The Inner join shows matches only when they exist in both the tables.For example, in the SQL below there are two tabl

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd