473,320 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to connect web and printer using wampserver2?

I want my page to be capable of printing data the user inputted in the page to a local printer. This is for our project. Please do help me. thank you.
Jan 17 '11 #1
1 1941
Printing is a built in functionality of the web browser you use, and unlike in a desktop application you don't need to worry about the technical functionality of printing here. Just select File > Print and it will take care of the rest (given that your system is setup properly for printing).

However, you need to make your web pages out put print compatible.
First thing you will need is a two set of CSS because you will need to style the page differently when printing. This can be easily done by using CSS media type. Your either define
Expand|Select|Wrap|Line Numbers
  1. $media print{
  2. }
block in your CSS, or you can include a separate style sheet targeted for print media.
Expand|Select|Wrap|Line Numbers
  1. <link href="style.css" rel="stylesheet" type="text/css" media="all" /> <!-- CSS for all (screen display + printing) -->
  2. <link href="print.css" rel="stylesheet" type="text/css" media="print" /> <!-- CSS for printing only -->
For more details see w3schools article "CSS Media Types" on this.

Another thing is, you should have a fluid HTML layout in your web page, meaning you should design the page layout using DIV tags instead of TABLEs.
For a single (print) page this will not make a different, but TABLE layout designs give you unpredictable results in where page breaks should occur.

Speaking of page breaks, you should use them wisely. Making sure that page breaks doesn't occur with in block elements, floated elements or elements with borders is very important otherwise browsers might ignore them completely and it will result in missing pages in the print.
Page breaks also doesn't work in absolutely positioned elements.
More details can be found in this "CSS page-break-after" w3schools article.
Jan 17 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: scrimp | last post by:
Well, Ive been searching through google groups and Ive seen a lot about printing a pdf file, but I havent seen a definite answer. I tried this code: f = open(printer_path, 'w')...
0
by: Tessa | last post by:
Is there any security reason why you cannot print to a network printer from ASP.NET under IIS6 on Windows 2003 server? I'm using ASP.NET code to print to a server print queue using...
0
by: Dawn | last post by:
My application is coded to create a report using Excel and I would like to send it directly to a pre-determined network printer. (My intention is to pass the printer name in a variable.) However,...
13
by: Susan Beebe | last post by:
I have downloaded the code described in Microsoft article Q154078. I am trying to send raw ZPL (zebra barcode printer) code from Microsoft access. It works just fine if I hard code the actual...
2
by: Crazyhorse | last post by:
Hi, I am trying to print labels to a zebra printer using the print document object in vb.net. Printing works fine to my local printer but with the Zebra, the data light indicator just flickers a...
3
by: yogesh | last post by:
how to connect MySQL using C++ in redhat .... can any one tell a sample of code to creat ,connect and execute the statement in c++ code ... please help me .....
1
by: amcgary | last post by:
Hello, I am trying to print a System.Drawing.Printing.PrintDocument to a dot matrix printer using C# .NET. I have created an instance of the PrintDocument and create a event handler for the...
0
by: IQBAL AHMED | last post by:
Hi I have developed a Shopfloor Project which I want to print a Bill in Dot matrix printer using VB.Net 2005. I don't know how to write the coding, set and print. Will you help to write the...
8
by: ncsthbell | last post by:
Is there a way to change my default printer using vb? I have some reports I want to print to a certain printer and some to a different one. I have a routine that loops through all of the reports to...
1
by: MayankSharma | last post by:
Hi I am new user in Windows Mobile development. I need help to make connectivity of pocket PC with Printer by blutooth and By USB by using C# coding. Please send any help to the mailID given...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.