Click here to Skip to main content
15,906,625 members
Everything / Print

Print

print

Great Reads

by Howard 9448490
Windows Forms Print Dialog for rich text with accurate page preview and zooming
by Bloody Chicken
Algorithm for printing an bitmap image with textwrapping and alignment in ESC/POS thermal printer.
by ToughDev
Emulate parallel port printer to capture data from Tektronix 1230 Logic Analyzer
by ASP.NET Community
zebra barcode printing using asp.netIt is really difficult to find something on internet to print zebra code from asp.net form Yes what

Latest Articles

by ToughDev
Emulate parallel port printer to capture data from Tektronix 1230 Logic Analyzer
by ToughDev
How to restore text from PDF files Encoded using custom CID fonts
by Howard 9448490
Windows Forms Print Dialog for rich text with accurate page preview and zooming
by Bloody Chicken
Algorithm for printing an bitmap image with textwrapping and alignment in ESC/POS thermal printer.

All Articles

Sort by Score

Print 

13 Aug 2020 by Howard 9448490
Windows Forms Print Dialog for rich text with accurate page preview and zooming
6 Oct 2013 by Sergey Alexandrovich Kryukov
This is because you did not write a single line putting any content in print document. Please read carefully: http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx[^].Please see the code sample at the end of this article. It shows how to handle the event...
2 Jan 2015 by Sergey Alexandrovich Kryukov
First of all, it's important to realize that forms are designed to be shown on screen, not printed; and the printer if very different device. You cannot resize, scroll, zoom or pan on a printed page, click on controls, drill down… So, in most cases, it's better to print not the form, but...
9 Apr 2017 by Peter_in_2780
The magic incantation is "%*d" as a format specifier. You then provide another argument (integer) to specify the width. See any good reference on printf format specifiers. (edit) you'll also need to specify leading zero padding. you'll find that in the sane reference.
16 Jul 2014 by CPallini
Some info here: PRINTDLG structure[^] (see nCopies explanation).
13 May 2015 by gitarci
hiI want to create one copy of any jobs in PrinterQueue to another printer.for example: I have 2 active printer (defaultprinter & printer2)when i print any document to defaultprinter i want print in 2 printers (defaultprinter&printer2)i tried this code in windows form...
18 Jun 2015 by F-ES Sitecore
If you're learning then you're better learning c# rather than vb.net as more people do it and it's easier to find code examples for.Create a base class (an abstract class) that has all your common properties, methods etc, and give that class an subtract method called onPrintPageEvent with...
11 May 2016 by Dave Kreskowiak
You're not sending anything to a "dialog". You're launching a separate process which takes command line arguments to tell it to print a file. Whether you can send multiple files to this process we have no idea. We don't know which application is registered to print .JPG files on your machine.
25 Jul 2016 by F-ES Sitecore
This is a frequently asked question, please do basic research such as a google search before you ask a question.The answer is that you can't. If the client wants to print something then they will. Would you want websites forcing things to your printer without your intervention?
11 Dec 2017 by Dave Kreskowiak
Nobody else pointed out that you're code will leak resource and eventually crash Windows. Those Font and Brush objects you're newing up need to have Dispose called on them to free up GDI resources. You cannot just new them up "fire and forget" style. A much cleaner version of the code would...
2 Feb 2019 by OriginalGriff
The whole idea of a PrintDocument is that the PrintPage method is used to print the data regardless of the destination. The difference is that for a PrintPreview you do this: PrintPreviewDialog ppd = new PrintPreviewDialog(); ppd.Document = myPrintDocument; ppdialog.Show(); And for a "real"...
5 Feb 2019 by OriginalGriff
If you feed your method a negative value then your condition takes effect - and you call your function again with exactly the same parameter value! So what happens? The value is still negative, so the condition is still true, so you do the same thing again. The solution is simple: don't pass the...
5 Feb 2019 by CPallini
Following Griff's wise suggestion... Try def word(num): d1=...
29 Jul 2019 by Dave Kreskowiak
Your question makes no sense. Web App? Console App? Windows Service app? You didn't do a very good job of explaining what app is running where and how these apps relate to each other. What are these apps doing? How does this "Print button" work? What is the code behind it? "Default Printer" is...
28 Feb 2023 by Richard Deeming
StringFormatFlags.DirectionRig...
3 Nov 2013 by Charan_Kumar
Hi friends,I am facing some browser issue while opening the new tab on buttonclick after condition is checked.protected void btnPrint_Click(object sender, EventArgs e){ DataTable dt = ....; if (dt.Rows.Count != 0) { string redirect =...
7 Nov 2013 by Marc Gabrie
#1 AFAIK, there's any Zebra printer which model is GC420GT! It's important to know the correct model of your Zebra (read on)#2 In ZPL, the ^MMC,Y command should be sufficient and placed at the beginning of your label format. I see you also have specified ^CN but from ZPL ref this commands...
17 Dec 2013 by Shishir037
why my sap crystal reportviewer print box like font from client side in asp.net mvc??????Please help me...I am tired but can not fix it??????????
24 Feb 2014 by Dave Kreskowiak
Well, you HAVE to run the Office applications to print the documents. What else are you going to use to open the documents, parse them to render the page and printer them?? Without Office, you have no code that knows how to interpret and render the documents!You don't neccessarily need...
16 Jun 2014 by Richard MacCutchan
Take a look at GDI Drawing and Printing[^].
16 Jun 2014 by Richard MacCutchan
I have discovered that the issue is to do with the default unit settings in the Graphics class, as described in http://msdn.microsoft.com/en-us/library/ms535812(v=vs.85).aspx[^]You need to use the following line of code to set it to pixels.g.SetPageUnit(UnitPixel);That now works in XPS...
1 Oct 2014 by Duncan Edwards Jones
The PrintPage() event is called once per page until the e.HasMorePages is false - therefore any code in that sub will be executed once per page.You need to specify (and initialise) your "what have I already printed" outside of this event otherwise it will always keep resetting.See the...
21 Oct 2014 by Duncan Edwards Jones
You could use this Form Print Control[^]
5 Nov 2014 by CPallini
An int64_t variable can hold your result. You have also to modify the printf format specifier accordingly.
10 Jan 2015 by AjithJoseph
I have solved it by using WMI. a sample function is here: public void PausePrintJob() { string searchQuery = "SELECT * FROM Win32_PrintJob"; ManagementObjectSearcher searchPrintJobs = new ManagementObjectSearcher(searchQuery); ...
29 Jun 2015 by OriginalGriff
That code is for sending raw printer data to a printer, effectively bypassing the printer driver which normally translates it into something the printer hardware can understand. It expects that the data it reads from a file is already compatible with the exact make and model of printer you are...
16 Aug 2015 by OriginalGriff
Use the PrintDocument class[^] - it allows you to control exactly what gets printed and where. The link includes a simple, basic example.
25 Jul 2016 by Richard Deeming
The C# code runs on the server. It cannot access printers connected to the client. Unless you can connect the printer directly to the web server, and run your application pool as a user which has the printer configured, that's not going to work.Code running on the client cannot print...
4 Sep 2016 by Duncan Edwards Jones
There is an overload to DrawString which allows you to specify the text alignment within a given rectangle - for example see the article A class to print and print preview a DataGrid or DataGridView control[^]Use that in preference to trying to pad the string with spaces.
20 Feb 2017 by Garth J Lancaster
As we've already figured this out in comments etc, but for completeness, here's the code for (int i = 0; i
9 May 2017 by Maciej Los
Follow the instruction from below links: Printing from ASP.NET MVC - Simple Talk[^] Rotativa, How to Print PDF in ASP.NET MVC[^]
24 Jun 2017 by OriginalGriff
Don't print the form at all: you can do it by capturing the screen as an Image, and drawing that image at A4, but it will look like rubbish on some screens, and unreadable on others. Instead, draw the information the screen is supposed to be displaying onto a PrintDocument: that way, you can...
14 Sep 2017 by EssenceGold
Working Code: Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click BufferImg() Dim b As New ToolStripButton b.Image = CType(PrintPreviewDialog1.Controls(1), ToolStrip).ImageList.Images(0) b.ToolTipText = "Print" ...
11 Oct 2018 by Richard MacCutchan
answer = len(content) for i in content That is not a valid Python statement; see 4. More Control Flow Tools — Python 3.4.9 documentation[^]. See also section 7.2.1 at 7. Input and Output — Python 3.7.1rc1 documentation[^].
6 Dec 2018 by RickZeeland
Maybe you can use IlifeSpanHandler before the print window appears: Capturing a pop up window using LifeSpanHandler and CefSharp[^]
6 Jul 2019 by Dave Kreskowiak
You can't. If you think about it, it's pretty obvious why. Until fairly recently, browsers didn't know how to render a PDF file on-screen. The browsers used the MIME type of the content to determine that it was a PDF file and looked up any registered "handler" for that type to decode and...
5 Oct 2019 by OriginalGriff
We can't really tell, but there are a couple of things you can look at. 1) VB code is executed on the Server, not the client - I assume that the printer is installed on the Server because you can't access client computers from VB. 2) On the server, the site runs as part of IIS, which does not...
14 Nov 2019 by Bloody Chicken
Algorithm for printing an bitmap image with textwrapping and alignment in ESC/POS thermal printer.
1 Sep 2020 by CPallini
The function returns a vector of integers, but cout isn't directly able to print them. There are (at least) two alternative solutions: Iteratively print the vector items in the main function: int main() { Solution twotwo; vector...
16 Sep 2020 by CPallini
To print an integer use the insertion operator
20 Jan 2021 by Richard MacCutchan
printf("Your name is %i",&aa); The variable aa is an int type so does not require the addressof operator (&) on a printf statement. However, it is unlikely that you actually want an integer as your character's name.
3 May 2021 by OriginalGriff
It's possible, yes - but it's going to be really, really difficult. You'll need to start here: RedMon - Redirection Port Monitor[^] (or find something similar) and then "decode" the printer output (as it isn't sent to the printer in the form of...
19 May 2021 by Wendelius
It's decades since I've used MSFlexGrid but looking at the options available nowadays, can you simply just print the grid to a printer and use "MIcrosoft PDF Printer" as the printer. This driver comes by default with Windows.
7 Oct 2021 by User 9916080
This maybe what you are looking for. From Google: Epson TM-T88III Drivers[^]
13 Sep 2022 by Rick York
I am not sure how this even compiles. The item m_map is declared as a typedef but I see no instance of that type declared. Anyway, the documentation for map::begin has sample code that displays a map's contents : map::begin - C++ Reference[^].
23 Nov 2022 by Richard Deeming
If you're using a Chromium browser (Chrome, Opera, or a relatively recent version of Edge), then you should be able to use the "paged media" CSS rules to control the orientation and margins: Paged media - CSS: Cascading Style Sheets |...
13 Apr 2023 by OriginalGriff
This is not a Windows (or Sewoo) tech support site: we are here for software development problems and support. You need to contact the printer manufacturers via their tech support - they will be familiar with their product and brand (which I for...
8 May 2023 by ToughDev
Emulate parallel port printer to capture data from Tektronix 1230 Logic Analyzer
8 Oct 2019 by Richard Deeming
Rather than shelling out to a DOS command, you can use code to send the ZPL directly to the printer. Here's the class I use to do that: Raw printer helper · GitHub[^] It's in C#, but you can either convert it, or compile it into a library and call it from your VB.NET code. ...
3 Oct 2013 by thatraja
Check this(Based on your exception message)Crystal Reports: Fix for "Load report failed" error.[^]
5 Oct 2013 by Mahesh_Bhosale
how to hide print button when window.print, also hide page number, date and time, url of printing page
5 Oct 2013 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Sorry, you can't do it. It is default browser behaviour.May be in future, browsers will allow us to code for that, but currently there is no such support.
6 Oct 2013 by Leo Rajendra Dhakal
it does not working. after keeping it it says no instance created.
6 Oct 2013 by Member 10319680
Hi, i need help with coding on how to print a report.I've got this so far, but when i print, i just print blank pages.. private void button1_Click(object sender, EventArgs e) { this.printDialog1.Document = this.printDocument1; DialogResult dr =...
11 Oct 2013 by ASP.NET Community
zebra barcode printing using asp.netIt is really difficult to find something on internet to print zebra code from asp.net form Yes what
11 Oct 2013 by ASP.NET Community
Today my topic is regarding the Printer Friendly Web Page in which I will share the best practice how to build the Printer Friendly page.The reason
29 Oct 2013 by ryter_michael
I did a print preview for my side, which shows some projects. These projects had very long texts ang overflows a side in the print preview. The problem ist the text are in the middle of the side, when it's overflow the side, it flows to the left side.How can i fix it?
3 Nov 2013 by shanthini24
Hello Every body!!! Belated diwali wishes!!!!!!!!!! Is it possible to send a mail with print option in asp.net with c# codingIn depth i just use a html file format as a body content and i want to send a print option along with that mail.here my...
6 Nov 2013 by Zoltán Zörgő
Have a look at the specification: http://www.servopack.de/support/zebra/EPL2_Manual.pdf[^]Supposing you have the cutter, a simple standalone C should do it.Is the rest of your code working? If not have a look here:...
8 Nov 2013 by saeed1364
I am enumerating printers connected in the PC. I done it using C# System.Printing namespace. It works well. But mostly it shows software printers like Microsoft XPS Document writer,Microsoft Fax etc. I would like to know is it possible to remove these ssoftware printers from enumeration
26 Nov 2013 by Sampath Lokuge
For that you can use javascript function window.print().For more info check below mentioned links:If you need to print an specific content, you can hide the rest (and format the printed area) by CSS: .noPrint{ display: block; } .yesPrint{ display: block...
12 Jan 2014 by Nosheen Javed
I have a radgridview in which I am displaying my data. My radgridview columns have different fonts. One column is simple but the other has BarCode font. Now I want to print that radgridview But when I click on the Print it is not showing the Barcode format in the file its generating whether its...
12 Jan 2014 by Gandalf_TheWhite
Get barcode font installed at machine.Code 39 is the Barcode fonts you will be needed.Check this solution for the reference.http://stackoverflow.com/questions/13076461/print-using-barcode-font[^]
16 Jan 2014 by Member 10528826
This one has been stumping me for a few months now, occasionally working on it from time to time and having no luck.We use SSRS 2008 R2, and had a GPO in place to auto-install the ActiveX control for the default print button on the SSRS ribbon (rsclientprint). That GPO worked for almost a...
18 Jan 2014 by ahmed.bayoumi
Hi All,How to solve a problem for Crystal report viewer when click on the print button it gives only export as PDF and not giving the list to select a local client printer.It was working fine and we can select local printers perfectly before and suddenly it shows PDF only, we have tried...
19 Jan 2014 by Rak_Avasthy.
In addition to PrintMode, you need to register a user control of crystal report (PrintControl.dll)you can do dis manually or add following lines in your web.config file -
20 Jan 2014 by Marc Gabrie
I think that will not work because rendering the report to HTML format for printing purposes might carry future headaches and you know, each browser has its own rendering engine that adds more problems to this scenario. My suggestion is you go for the PDF approach as is stated here but instead...
20 Jan 2014 by Marc Gabrie
I think main problem here is that Crystal Reports client printing feature relies on ActiveX which is not allowed by IE11 if it is not forced to render pages as IE9 or earlier versions. That's why Crystal tries to export the report to PDF instead of printing. I should avoid ActiveX printing as it...
24 Jan 2014 by Sriram Ramachandran
I've data in gridview in C#. I need to print and Save as PDF and Excel. Is there any best links to do this all operations. Someone help me please .....
24 Jan 2014 by V5709
Refer following links.Export to PDFExport to PDF/Exel
24 Jan 2014 by Marc Gabrie
I'd create a simple RDLC (local report) with a grid bound to a data set (the same you used for your GridView)Then you can export it to PDF & Excel through code http://forums.asp.net/t/1556522.aspx?RDLC+Export+directly+to+Excel+or+PDF+from+codebehind[^] and you can get it printed as described...
24 Jan 2014 by Sergey Alexandrovich Kryukov
To create PDF, you can use the .NET port of iText; this port is called iTextSharp:http://en.wikipedia.org/wiki/IText[^],http://itextpdf.com/[^],http://sourceforge.net/projects/itextsharp/[^].I provided links to iText, too, because nearly all documentation you need to work with...
27 Jan 2014 by deepakdynamite
I have a scenario where there are 3-4 textboxes on aspx page and a print button.My requirement is to save values of textboxes in database if user actually prints that page.I am using Window.Print for printing that page. But How would I know if user has clicked in print button or Cancel...
27 Jan 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
You can't have any control of user's activity once Print Preview Dialog is opened.However, you can do something, when the Print Button on your page is clicked. Do something on Print Button Click event and after that, call window.print().
29 Jan 2014 by deepakdynamite
We have a ASP.net page with 4 textboxes and data saved in textboxes. I want to create a button which will result into a pop-up showing three controls:1. Dropdown showing list of Printers ( Selected printer should be used for printing purpose)2. Showing number of copies to be printed....
30 Jan 2014 by Marc Gabrie
With ASP.NET...1. You cannot get a list of installed client printers. ASP.NET is a server side framework that cannot access client machine. To get a list of installed printers at the client side you need an external tool based on some client tech like ActiveX, Flash, Silverlight,...
3 Apr 2014 by Charan_Kumar
check these links http://msdn.microsoft.com/en-us/library/cwbe712d%28v=vs.110%29.aspx[^]http://www.dotnetcurry.com/showarticle.aspx?ID=104[^]
25 May 2014 by mustor
Hello,PrintI can print at IE. But It does not work at Chrome. Please helpp...Thank you
31 May 2014 by Tarun Jaiswal
Gridview Control have more then 100 rows of data, which is displayed in six to seven pages.how i can Print ASP.Net GridView with page breaks and repeat header to each page.actually i have some code which work on Internet Explorer 11.0.9600 [Windows 8.1] but not on Google Chrome means it...
14 Jun 2014 by AlwaysLearningNewStuff
I am learning to use print property sheet so I can start learning printing by drawing a rectangle on the paper.My problem is that I do not have a printer, and am testing the results by printing to XPS file and MS Office OneNote 2007. I am drawing the rectangle with this code snippet ://...
26 Jun 2014 by Narendra Singh
I am developing a cyber cafe web application where admin want to get details of number of print out taken from every system . please help me how is it possible. Please help me.
26 Jun 2014 by DamithSL
it depend on how users took printouts. for example if user get print screen and past it on mspaint and took printout from that, you can't get print information of such case from ASP.NET.But if you have print button on your asp.net web page and you can save record to database with print details...
16 Jul 2014 by Dire_st
I was able to find how to set the From and To page numbers in the Print Dialog,but I haven't been able to find out how to set the number of copies to anything other then 1.here is one of the many iterations I have tried: CPrintDialog dlg(FALSE); dlg.m_pd.Flags &= ...
18 Jul 2014 by nsht3275
AutoCAD can do it.It is an industry - level 3D software, can support large data of 3D printing.
22 Jul 2014 by ahmed_elsayed_e
Hi alli have Proplem win printing report in half A4 verticalsee attahment with ms access is ok with crystal report no
23 Jul 2014 by Sifar - 0
Hi,How can we print an HTML document to a specific printer without changing the default printer settings and without showing up a Print dialog? I have tried ExecWB; it goes to a default printer.And, in my development scenario, I can use System.Windows.Forms.WebBrowser, I cannot use...
12 May 2016 by Hedi Sangoku
I'm using the following code to pase spooler spl files (get the emf file structure)#include "stdafx.h"#include #include #include #include #include #include using namespace std;BOOL AnalyseFile(const char*...
21 Aug 2014 by Member 11027354
I have a small application based on sql(MS Access or VB). I can printing a receipt of a form contain a subform also. But when printing, paper feed by printer is more than its content size, although form may shink and grow depend upon number of content(like a bill at grocerry). Here, number of...
21 Aug 2014 by Yvan Rodrigues
Windows has support for roll printers, but it isn't very good. You still have to print to a "sheet", but it is slightly easier to change its size.I have written many applications for roll/receipt/label printers and I never use the Windows driver. Instead I write in the printer's native...
4 Sep 2014 by liutaoxwl
i want to get a image when user print from other applications.then i hook some api.first i hooked createdcw and in my hook funciton, i create a memory dc(by CreateCompatibleDC(NULL) ) and return. but the target application show a error.then, i in my createdcw i create both printer...
8 Sep 2014 by Aitizaz Khan
I have been searching for an answer for a month now but i am unable to find the exact solution or a method or from where to start.I want to create an application that logs the data printed. for example if I print "abcd" from notepad I want to capture this "abcd" from my software.I want...
8 Sep 2014 by Duncan Edwards Jones
If you set the print spooler setting "Keep printed documents" then the spool file will be stored after the print completes and (if you also choose to spool EMF files) this can be read with this EMF Printer Spool File Viewer[^]There are some complexities as this is not an easy task - for...
10 Sep 2014 by bling
This article shows how to use the printing API.Printing without the Document/View framework[^]Look for StartDoc/StartPage/EndPage/EndDoc. You may be able to intercept those GDI functions.
25 Sep 2014 by shafeeqpv
I am printing invoice using PrintDialogue and PrintDocument. Invoice details are handling using Data Grid View.Data Grid View is iterating using for..each statement.I have already set e.hasMorePages into true.But printing invoice rewriting same pages.Not came in separate pages.Please help me to...
2 Oct 2014 by Duncan Edwards Jones
I think you have to fall back on the Windows API. Try the control on PrintQueueWatch.codeplex.com and see if that works for you?
3 Oct 2014 by Member 11127373
hi friends am having a jbutton actionperformed, i need to print the jtables and some jlabel's text before and after the jtable. Kindly help me to rectify this problems friend
6 Oct 2014 by Nelek
Reading the error it seems the name you are giving is not matching the correct format or maybe not existant in your system.Have a look to these links, they might...
9 Oct 2014 by Member 10117590
The Zpl printer was connected to Standard Serial port via Bluetooth. I solved it by following this link Printing label and Barcodes using ZPL printer from C#.Net