Questions tagged [printdocument]

Defines a reusable object that sends output to a printer, when printing from a Windows Forms application.

289 questions
6
votes
1 answer

DefaultPageSettings.Margins not adding margins

Based from the documentation, adding these codes should add margin to the print document, but when I used it in my codes, I can't see any margin being added. Is my usage on the code correct? Here is the code from MSDN: printFont = new Font("Arial",…
Carl Binalla
  • 5,393
  • 5
  • 27
  • 46
6
votes
0 answers

How to print PDF in UWP without loosing quality after rasterization to PNG

After some investigation of printing in UWP I've highlighted: No native way to print PDF document directly from your app without redirecting this task to Edge or other similar program. There is a way to print XAML Elements (Image for example) using…
6
votes
2 answers

PrintDocument always has margin

I am having a problem when using PrintDocument with margins. No matter what I do there is always a margin around everything I print, this means that nothing is aligned where it needs to be. Here is the code I am using to create the…
Nick Williams
  • 1,237
  • 6
  • 19
  • 40
6
votes
4 answers

ASP.NET IIS server side printing fails

I'm building an ASP.NET application that requires printing using PrintDocument method: PrintDocument.Print() Printing works properly in development env with IIS express. when publishing it to an intranet IIS server, printing fails, which I think is…
AlBaraa Sh
  • 2,202
  • 3
  • 20
  • 29
6
votes
1 answer

How to jump to the next page in a PrintDocument?

I have an application that prints how many bar codes you want, but if the amount of bar codes is bigger than the size of the PrintDocument it doesn't jump to the next page. I'd like to know how can I add more pages or write in the next page of a…
Zignd
  • 6,896
  • 12
  • 40
  • 62
5
votes
2 answers

Dynamic paper height with .NET PrintDocument using TVS Dot Matrix Printer

My requirement is that I need to print invoice, it may contain 10 line or may contain 20 line. Every thing should be in the one invoice. For e.g. if you go to any supermarket, if you buy 3 items, you may get small sized bill. If you buy 30 items,…
Vignesh Kumar A
  • 27,863
  • 13
  • 63
  • 115
5
votes
1 answer

Active printer problem in Printing word document through VB.net

My printer name is \\abc\First Floor A-Block its taking name \abc\First Floor A-Block on NE04:. How should i print it Private oWord As Word.Application Dim lobjDoc As Word.Document Dim strFolder as String Dim pd As New PrintDocument Dim…
sweety
  • 51
  • 1
  • 2
4
votes
2 answers

How to set up and print with custom paper size in C# printdocument?

I am trying to use PrintDocument and set up the paper size to print or barcode thermal printer. Because I don't have the printer nearby I am using Microsoft Print To PDF option which appeared in Win10. During initialization I have such code: As…
Ivan P.
  • 832
  • 2
  • 9
  • 26
4
votes
2 answers

Easiest way to add a Header and Footer to a Printing.PrintDocument (.Net 2.0)?

What's the easiest way to add a header and footer to a .Net PrintDocument object, either pragmatically or at design-time? Specifically I'm trying to print a 3rd party grid control (Infragistics GridEx v4.3), which takes a PrintDocument object and…
Andrew
  • 12,991
  • 15
  • 55
  • 85
4
votes
1 answer

Print Image to file using PrintDocument

I have C# project (ClassLibrary in ASP.NET MVC project) I want to print an Image (System.Drawing.Image) to file using PrintDocument private static void SendToPrinter(Image barkod) { PrintDocument pd = new PrintDocument(); pd.PrinterSettings…
Hakan Fıstık
  • 16,800
  • 14
  • 110
  • 131
4
votes
2 answers

How to draw unicode string using C# graphics.DrawString

I'm trying to send khmer script(unicode) string to printer using PrintDocument provided by the .NET framework. Unfortunately it seems to me that the Graphics.DrawString() does not render khmer script correctly. Platform: Windows 7 Ultimate IDE: VS…
lchanmann
  • 357
  • 2
  • 10
4
votes
3 answers

How to print a text file on thermal printer using PrintDocument?

I'm creating an application using C# with Winforms and now I need to print the receipt of sale on a thermal printer. To do this I'm creating a text file and reading it to print using the PrintDocument but I cannot do this because I don't know how…
FernandoPaiva
  • 4,410
  • 13
  • 59
  • 118
4
votes
2 answers

printdocument adds blank page

I'm trying to print data from a database using printdocument and i got it to where it prints the data from the specified range but there are still 2 things that go wrong the things that still don't work like intended are on printing if a page is…
maam27
  • 444
  • 3
  • 21
3
votes
1 answer

Print images on multiple pages

I have barcode images in a folder and I want to print them like in the image below. But the problem is I can't make the rest of the image go to the next page. In this situation, I have 22 images, but the paper fits only 20 to 21 (the last image is…
bryanjez
  • 439
  • 4
  • 8
3
votes
1 answer

C# Print pdf file programmatically?

My printing code given below void SaveReport(Telerik.Reporting.Report report, string fileName) { ReportProcessor reportProcessor = new ReportProcessor(); Telerik.Reporting.InstanceReportSource instanceReportSource = new…
Prasanna Kumar J
  • 1,288
  • 3
  • 17
  • 35
1
2
3
19 20