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

Development of app using windows phone sdk, Windows Phone 8 Player - Radio ...

Windows Phone 8 Player - Radio Live Streaming Native XAML and C# Project Description: Player for Windows Phone 8 Scope: The project evolves the development of app using

Dispose method in .net, What is Dispose method in .NET? The .NET provid...

What is Dispose method in .NET? The .NET provides "Finalize" method in which we can clean up our resources. But relying on this is not always better so the best is to implement

Vb 2010, how to create log in form using vb 2010

how to create log in form using vb 2010

Current culture of the environment in windows and asp.net, How we get the c...

How we get the current culture of the environment in windows and ASP.NET? The "CultureInfo.CurrentCulture" represents the current culture of the environment. For illustrate if

How many types of generations are there, How many types of generations are ...

How many types of generations are there in a garbage collector? Memory management in the CLR is separated into three generations that are building up by grouping memory segment

Experienced outlook developer, About us in a nutshell: We are a young start...

About us in a nutshell: We are a young start-up that trade a refreshing product in the field of enterprise software and develops with the latest technologies. We love to partner wi

Viewstate, What is ViewState? The Viewstate is built-in structure for a...

What is ViewState? The Viewstate is built-in structure for automatically retaining the values among the multiple requests for the similar page. The viewstate is internally main

Explain fully how ado.net functions, Question : (a) Explain fully how ...

Question : (a) Explain fully how ADO.NET functions. Illustrate your answer using a diagram. (b) List and explain three methods of the SqlCommand class. (c) Give four o

Tsql function sql server 2012, TSQL Function SQL Server 2012 Project Des...

TSQL Function SQL Server 2012 Project Description: I require someone to prepare a TSQL function that returns the name of the ODBC DSN. I will use the queries below, to get

I need a dataflow system, Development Executive of DataFlow System, We s...

Development Executive of DataFlow System, We started by initially providing our customers with customized ITES solutions and IT. We have now expanded our services which add QA s

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