15,884,237 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Marc Gabrie (Top 110 by date)
Marc Gabrie
29-Nov-14 7:05am
View
What do you want to print? the content page? some file in known formats like doc, pdf?
Marc Gabrie
25-Oct-14 7:37am
View
Is your project a desktop Windows app or ASP.NET website?
Marc Gabrie
31-Aug-14 16:00pm
View
Is it an ASP.NET website or Windows desktop? Which kind of printer (brand & model) are you targeting?
Marc Gabrie
10-Aug-14 8:53am
View
Is your printer attached to the machine where your PHP project will be hosted?
Marc Gabrie
5-Jul-14 7:09am
View
What kind of barcode type do you need? What have you tried so far?
Marc Gabrie
5-Jul-14 7:05am
View
Are you talking about a desktop app or ASP.NET website?
Marc Gabrie
5-Jul-14 7:00am
View
Is it a desktop app or an ASP.NET website? What printer brand are you targeting?
Marc Gabrie
15-Jun-14 9:52am
View
What do you want to print? a file like a pdf? the page content? what?
Marc Gabrie
15-Jun-14 9:47am
View
CP is not for providing third-party tools support so go and contact them directly ;-)
Marc Gabrie
8-Jun-14 13:01pm
View
What exactly do you want to print? elaborate a bit please
Marc Gabrie
4-May-14 21:53pm
View
how your code looks like for printing through USB conn?
Marc Gabrie
10-Apr-14 7:15am
View
What kind of printer are you targeting? A dot-matrix one?
Marc Gabrie
7-Apr-14 14:34pm
View
What kind of printer are you targeting? What kind of doc do you need to print? A receipt? A bill?
Marc Gabrie
31-Mar-14 13:41pm
View
you are sending EPL commands to the printer so.... are you sure that your printer does understand it i.e. is EPL capable? maybe it supports ZPL only? Which is the printer model?
Marc Gabrie
31-Mar-14 13:25pm
View
I've to disagree with your comment. Thermal printers come with a firmware that is capable of understand simple printer commands like ESC/POS, ZPL, EPL, etc depending on the printer brand. Those commands are designed to be lightweight and printing performance is way much faster when using raw printer commands that a graphic approach through a Windows driver + Windows API (the one produced by PrintDocument). In a scenario where fast printing performance and/or big printing volume is priority-one, then PrintDocument approach is a no way option IMHO.
Of course PrintDocument is a generic approach that will work with any kind of printer, but in this case this member is asking for thermal printing scenarios i.e. very specific, and for me, raw printing approach is the way to go.
Marc Gabrie
24-Mar-14 6:43am
View
You'll not get any useful answers or help if you do not clarify your question. What does "barcode 5 textbox" mean for you?
Marc Gabrie
10-Mar-14 15:31pm
View
May you clarify and elaborate a bit more? You can write more that 140 chars here ;)
Marc Gabrie
6-Mar-14 7:47am
View
http://stackoverflow.com/questions/1542320/margin-while-printing-html-page
Marc Gabrie
3-Mar-14 10:26am
View
It's the name you assigned to the image which you stored in the Session that you want to display. That is the param that the Handler will take to get the image from the Session object and render it back to the client.
Marc Gabrie
1-Mar-14 15:45pm
View
He's using ASP.NET not Windows Forms. If you use PrintDocument in ASP.NET, you'll be able to print at server side only.
Marc Gabrie
19-Feb-14 15:07pm
View
If you've specified the image as is, then it won't work. Remember that you have to send printer commands and the image needs to be converted to that by following the programming manual.
Marc Gabrie
19-Feb-14 15:05pm
View
For offline scenarios the only thing I can think of is to convert PDF to image files using some tool from ASP.NET (look at some solutions here http://stackoverflow.com/questions/3492129/converting-pdf-file-to-images-using-c-sharp)
Marc Gabrie
18-Feb-14 18:06pm
View
well the error is very explicit, there's an error in converting types. You've not included the code where the error is happening i.e. where you are using SQL classes. Post the complete code.
Marc Gabrie
5-Feb-14 7:20am
View
That code should work and is not complicated to understand. If you want to save the image on disk, then just using bitMap.Save() but specify a file path instead of a MemoryStream
Marc Gabrie
4-Feb-14 15:31pm
View
have you tried "Solution 1" below?
Marc Gabrie
3-Feb-14 10:41am
View
when debugging, your machine acts like the server & the client machines at the same time, that's why your code works. But when you deploy your website to another server machine, then your asp.net code will run there NOT on the client machine.
Now, the question... Do you want to get a list of the installed printers at the client machine? If yes, for what purpose?
Marc Gabrie
3-Feb-14 10:38am
View
that code does not generate any barcode! or are you using a barcode font? Elaborate/clarify a bit to get a better answer
Marc Gabrie
1-Feb-14 6:25am
View
You should download ZPL manual from Zebra website
Marc Gabrie
1-Feb-14 6:17am
View
That is a very different scenario then. Anyway, to get a lis of installer printers from your "internal website", you should develop a Windows Service project that could list the printers installed on the machine where it will run by using this code http://msdn.microsoft.com/en-us/library/system.drawing.printing.printersettings.installedprinters(v=vs.110).aspx
Your Windows Service should be the listener in a TCP Client/Server model (http://www.codeproject.com/Articles/1415/Introduction-to-TCP-client-server-in-C). Then your code at the server should connect to that listener on the client and get the installed printer from it.
Marc Gabrie
30-Jan-14 21:06pm
View
The main problem is... you cannot use C# to print to the client printer in an ASP.NET scenario. The C# code you write in your website is executed in the web server where you host your site not on the client machine.
Marc Gabrie
29-Jan-14 7:06am
View
do you mean they are not displayed? what is exactly the issue?
Marc Gabrie
29-Jan-14 7:02am
View
do you mean.... scan a barcode using a physical scanner/reader OR you got the barcode image (digitally) and you need to decode the barcode that might be found in that image?
Marc Gabrie
29-Jan-14 6:25am
View
what image format (PNG, JPG, TIF, etc) are your images and what is the size in both W&H (pixels) and in bytes?
Marc Gabrie
25-Jan-14 7:09am
View
ok that printer seems to emulate ZPL (Zebra language) so I updated the answer with some resources
Marc Gabrie
25-Jan-14 6:35am
View
thanks. below is my answer. By the way, which exact Citizen model is your printer?
Marc Gabrie
25-Jan-14 6:17am
View
What did you mean with "CLS printer"? And are you going to develop a Windows desktop app or an ASP.NET one?
Marc Gabrie
24-Jan-14 8:42am
View
refer to that page! ZXing is a barcode software reader written in Java that you can use in your app to read/scan barcode symbols from an image file.
Marc Gabrie
22-Jan-14 7:29am
View
Use "Improve question" link to precisely improve your question as it's not clear what you really want to do.
Marc Gabrie
16-Jan-14 8:17am
View
Use "Improve question" link instead of making a new one
Marc Gabrie
16-Jan-14 6:58am
View
Is it a "normal" web page or one that you have designed for printing purposes? If it was designed for printing, then maybe you can create a PDF or other kind of document to get it printed without those unwanted legends.
Marc Gabrie
14-Jan-14 9:22am
View
I do not have a specific sample but you can get many hints by googling "css for print". And for javascript printing, just add a button or link with the window.print(); code in the onclick event.
Marc Gabrie
14-Jan-14 6:30am
View
What kind of document do you need to print? or it's something that you have to create by yourself?
Marc Gabrie
13-Jan-14 13:54pm
View
Why are you using a font and not just generating barcode in image format instead?
Marc Gabrie
7-Jan-14 10:23am
View
Sorry but I don't understand your question at all. Anyway, yes, you have to export the report to txt before sending it to the printer through the LPT port.
Marc Gabrie
3-Jan-14 5:55am
View
ok I doubt that any printer can handle raw html so you should first convert the html to some other format like an image or PDF maybe and then print it to the printer instead. The link provided by Richard above could be a solution.
Marc Gabrie
2-Jan-14 9:35am
View
Is it a desktop app or an ASP.NET website what you are developing there?
Marc Gabrie
22-Dec-13 5:37am
View
Be sure the data set name you create in code matches with the one you used to create the report at design time.
Marc Gabrie
21-Dec-13 4:40am
View
Where is your actual code that is supposing failing or not working properly? Posted it here to know how are you trying to print that bill.
Marc Gabrie
19-Dec-13 11:39am
View
Create a Generic Handler (ashx file) called DisplayPdf.ashx then pass a param to it identifying your file. the url param for the Google Doc Viewer should look like this:
url=http://yourwebsite/DisplayPdf.ashx?id=123
Then in the handler (under ProcessRequest) just read the PDF from your local disk by using the id param i.e. something like this:
//get the id from the URL param
string myId = context.Request["id"];
//validate id and if success....
context.Response.ContentType = "application/pdf";
context.Response.BinaryWrite(System.IO.File.ReadAllBytes("c:\temp\yourfile.pdf"));
Marc Gabrie
18-Dec-13 8:24am
View
Improve your question! It is not clear what the issue is. Use the "Improve question" link.
Marc Gabrie
13-Dec-13 7:04am
View
did you tried all the links I pointed you before?
Marc Gabrie
11-Dec-13 18:33pm
View
By "print it in decorated Word format"... do you mean to "export" that webform in Word format? please clarify a bit.
Marc Gabrie
10-Dec-13 5:32am
View
Instruct the user to upload that text file to some page of your site. AFAIK, there's no way to automate that.
Marc Gabrie
10-Dec-13 5:31am
View
Deleted
Instruct the user to upload that text file to some page of your site. AFAIK, there's no way to automate that.
Marc Gabrie
9-Dec-13 22:03pm
View
I agree that there seems to be a font problem BUT do you mean that with other browsers (like IE) your report works? Because you mentioned Chrome & FF only.
Marc Gabrie
3-Dec-13 6:53am
View
The only way to get it printed without any dialog is by using
this tool
but it's a commercial product. I couldn't find any open source that can be used in this scenario.
Marc Gabrie
1-Dec-13 8:49am
View
have you tried using javascript window.print() approach?
Marc Gabrie
30-Nov-13 10:47am
View
What kind of report i.e. are they PDF files? and you want to print that to the client printer?
Marc Gabrie
29-Nov-13 12:29pm
View
What class are you using there? There's an obj called "printer" you have in your code... what is that? an external library? elaborate a bit.
Marc Gabrie
27-Nov-13 8:09am
View
You can scan as many barcodes as you want in the textbox (make it multiline) and after you finish scanning, then click on anything (maybe a button) to process and save those scanned values.
Marc Gabrie
26-Nov-13 16:16pm
View
XPS is not a format supported by web browsers (maybe IE is the only which may display it, not sure)
And to print that format, some XPS software (like the XPS Viewer) needs to be installed at the client machine. Why are you trying to print XPS format? Don't you have any other way to use PDF or an image instead?
Marc Gabrie
23-Nov-13 5:38am
View
Do you mean printing to a printer installed at the client side or available at the server hosting your PHP website?
Marc Gabrie
21-Nov-13 11:51am
View
simple linear barcodes like Code 39, Code 128, etc can encode that. Code 128 is most reliable & compact than Code 39 and can be decode by any simple scanner these days.
Marc Gabrie
21-Nov-13 11:50am
View
Deleted
simple linear barcodes like Code 39, Code 128, etc can encode that. Code 128 is most reliable & compact than Code 39 and can be decode by any simple scanner these days.
Marc Gabrie
21-Nov-13 9:48am
View
what is the code under your printdoc() method? and are you aware that your ActiveX will work with IE only i.e. not on other browsers?
Marc Gabrie
12-Nov-13 5:49am
View
What kind of document you want to print? Word? Excel? PDF? an Image? what???
Marc Gabrie
8-Nov-13 6:38am
View
If you are using System.Drawing for printing, then you are sending output printing jobs through the Windows driver for GC420T. If you have installed ZDesigner driver, then select Printing Preferences and under Advanced Setup tab you have the option to enable the Cutter under Operation Mode. Give it a try.
Marc Gabrie
6-Nov-13 12:53pm
View
Totally agree with you Espen but problem is that maybe he needs to target common printers like laser or inkjet and that's (maybe) why he's using System.Drawing.Graphics class
Regards,
Marc Gabrie
25-Oct-13 6:22am
View
You have to consider that when printing with PrintDocument, you have to write code for printing 2 labels. When PrintDocument PrintPage event is raised, you'll have to print both labels as that event "happens" per printing row.
For generating barcodes and print them through PrintDocument, I'd recommend you
zxingnet.codeplex.com
which is free & open-source or
this
which is paid. I personally will discourage you to use barcode fonts i.e. TTF which can be used to print barcodes to avoid future headaches with barcode verifiers.
Marc Gabrie
24-Oct-13 16:22pm
View
do you mean printing two labels per row on the roll media?
Marc Gabrie
24-Oct-13 16:20pm
View
And how do you generate the labels? I mean, do you generate images or pdf files instead of raw Zebra commands?
Marc Gabrie
24-Oct-13 15:43pm
View
May I ask you what kind of label printer are you targeting i.e. is available at each client machine?
Marc Gabrie
8-Oct-13 15:09pm
View
What do you mean by "code 39 ex"? If "ex" stands for "Extended" then you already are able to encode full ASCII code 39 as "Extended" is another name for "full ASCII" code 39 symbols.
Marc Gabrie
7-Oct-13 7:20am
View
What kind of printer are you targeting? and are the checks on a continuous roll or single pages?
Marc Gabrie
5-Oct-13 6:33am
View
What thermal printer (brand & model) are you targeting?
Marc Gabrie
2-Oct-13 11:42am
View
If you not distribute your source code app, then you will have to pay for iText. read
http://itextpdf.com/pricing
...buying a commercial license is mandatory as soon as you develop activities involving the iText software without disclosing the source code of your own applications.
Marc Gabrie
2-Oct-13 11:35am
View
what is the error you get there???
Marc Gabrie
26-Sep-13 7:16am
View
You first must determine which Printer Command Language your printer supports as ESC/POS is NOT the only one!!! If you have a Zebra printer, then ZPL or EPL are needed not ESC/POS. Other brands also have their own languages. So first of all, check that and then go ahead.
Marc Gabrie
26-Sep-13 7:12am
View
What kind of barcode type you are printing there? which font? Sometimes (always I'd say) fonts are suitable for printing readable barcodes. And how are you printing it... through PrintDocument?
Marc Gabrie
13-Sep-13 8:10am
View
keep in mind that query string length has a limit!!! each browser has different limits (just google about this topic to get those values) Maybe you should go for doing a HTTP POST like stating here http://stackoverflow.com/questions/566462/upload-files-with-httpwebrequest-multipart-form-data
Marc Gabrie
12-Sep-13 13:31pm
View
validate that the variable "file" is not being null. Are you sure you used the same query string I posted here? Seeing your code it seems you have some space between "...? q=" which should not be there. Put a breakpoint in your aspx code and see what is going on...
Marc Gabrie
11-Sep-13 8:48am
View
You can store byte array in QR Code!!! The QR Code specification (which I've read it all :s) states that a QR Code symbol can store up to 2,953 bytes! Of course, that's too low capacity to store an image like a photo but a small icon could be ;)
Marc Gabrie
10-Sep-13 14:55pm
View
But you can also preview the PDF report by using Google Doc Viewer! Just add this html code to a page that will preview the PDF report:
<iframe src="http://docs.google.com/gview?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>
Just replace the pdf file there with yours.
Marc Gabrie
7-Sep-13 8:20am
View
does it happen with some specific browser? CrystalReports print functionality does not work with any browser.
Marc Gabrie
29-Aug-13 13:08pm
View
it does not need any plug-in installed at the client machine as Google Viewer render the PDF as an image! have you tried it? if not, then do it
Marc Gabrie
21-Aug-13 8:57am
View
please elaborate a bit more about your needs as it's not clear for me what you really want at all. thanks,
Marc Gabrie
15-Aug-13 7:34am
View
Does your report have a data source? if yes, then:
"Product": you must change it to match the name of your report's data source name
data: it must be your data source obj e.g. a DataTable, a Collection, etc.
Marc Gabrie
12-Aug-13 18:05pm
View
you're welcome! glad to help. cheers
Marc Gabrie
1-Aug-13 8:06am
View
Your question is not clear for me so may you clarify a bit about what you are looking for?
Marc Gabrie
31-Jul-13 13:18pm
View
what kind of documents are those? doc? xls? pdf?
Marc Gabrie
30-Jul-13 11:46am
View
you're welcome! I'm glad to hear you got it working and thanks for sharing your solution as it'll help someone else experiencing the same issue
Marc Gabrie
30-Jul-13 11:46am
View
Deleted
you're welcome! I'm glad to hear you got it working and thanks for sharing your solution as it'll help someone else experiencing the same issue
Marc Gabrie
24-Jul-13 8:56am
View
You want the report to be printer to the client printer or to a printer which is installed at the server?
Marc Gabrie
24-Jul-13 8:55am
View
You are coding an asp.net website, right? if yes, then no PrintDialog will be displayed! Again, your code runs at server side and the dialog "is displayed" at the server but not at the client machine through the browser.
Marc Gabrie
22-Jul-13 13:17pm
View
ok have you taken a look at the links I provided you above? I think the third one has a code for printing to default printer but it uses an utility that needs to be installed at the client + it's not free, sadly. The second link also has a solution but it requires more user intervention. Review those links and let me know.
Marc Gabrie
21-Jul-13 8:14am
View
sorry but I cannot figure out what you want to do at all. Do you want to get the report (rpt) printed to the "Default" printer at the client machine? clarify a bit please. thanks,
Marc Gabrie
21-Jul-13 8:14am
View
Deleted
sorry but I cannot figure out what you want to do at all. Do you want to get the report (rpt) printed to the "Default" printer at the client machine? clarify a bit please. thanks,
Marc Gabrie
19-Jul-13 18:30pm
View
Deleted
And maybe you must change this line:
<html xmlns="http://www.w3.org/1999/xhtml">
to just this:
<html lang="en">
Marc Gabrie
19-Jul-13 18:28pm
View
To get the meta tag applied, you must change the DOCTYPE as I told you before. You have this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Modify it so it looks like this simple line:
<!DOCTYPE html>
And maybe you must change this line:
<html xmlns="http://www.w3.org/1999/xhtml">
to just this:
<html lang="en">
Marc Gabrie
19-Jul-13 10:21am
View
Add the following line BEFORE the <html xmlns="...">
<!DOCTYPE html>
Marc Gabrie
4-Jul-13 12:48pm
View
You're welcome! Glad to hear that worked. Cheers,
Marc Gabrie
2-Jul-13 13:52pm
View
Are you using Internet Explorer 10? or it is not working with any other browser either like Chrome, Firefox, etc?
Marc Gabrie
2-Jul-13 13:49pm
View
what is the code you have tried? what error did you get there?
Marc Gabrie
24-Jun-13 15:02pm
View
Spammer!
Marc Gabrie
19-Jun-13 13:26pm
View
you're welcome! glad to hear it helped you.
Marc Gabrie
15-Jun-13 14:32pm
View
What do you really want to do? Print the current page? A report? Elaborate a bit
Marc Gabrie
13-Jun-13 13:47pm
View
remove that spammer!
Marc Gabrie
9-Jun-13 8:19am
View
Then maybe you need to handle any input in a global way. Try
this
Marc Gabrie
9-Jun-13 8:18am
View
Deleted
Then maybe you need to handle any input in a global way. Try
this
Marc Gabrie
6-Jun-13 10:26am
View
The focus should be on the textbox but try handling other events like TextChanged
Show More