C# PRINTDOCUMENT SAVE TO PDF

The PDF document can be generated from the print document by using the // Event handler to save the PrintDocument page as image. Save PrintDocument to Image: Need help understanding this procedure. For that I use PrintDocument, for preview PrintPreview. I have a Could you tell me how to save printdocument to PDF format, please??.

Author: Nezahn Kajimuro
Country: Cape Verde
Language: English (Spanish)
Genre: Literature
Published (Last): 19 November 2004
Pages: 402
PDF File Size: 4.97 Mb
ePub File Size: 13.62 Mb
ISBN: 162-2-86033-998-6
Downloads: 32034
Price: Free* [*Free Regsitration Required]
Uploader: Voodoojar

I have been sending text and graphics to an image and then using DrawImage to draw the image to a PrintDocument. The benefit of doing this is that I could used one block of code to generate an image that I could either print, display or save.

Unfortunately, the printed image does not look that good.

How to generate PDF from Print Document?

Is there a way to print to the PrintDocument and then save the contents of the PrintDocument as an image? You can call the PrintPage event with the graphics of your choice. Code Block Public Class Form1. Dim Bmp As Bitmap.

  ETIKETAS KIEKVIENAM PDF

C# Imaging – Image Saving & Printing in C#.NET

Object, ByVal e As System. Dim G As Graphics. DrawImage New Bitmap “C: If it works, it is the correct way.

Rather than an object I would have passed a PrintPageEventArgs with different graphics, but it doesn’t matter. I didn’t, but you may. It contains the page and margin dimensions.

It would be cleaner if you could replace the Graphics in e, but it’s read-only. You have to pass the Graphics separately. This site uses cookies for analytics, personalized content and ads. By continuing to browse this site, you agree to this use.

The content you requested has been removed.

Remove From My Forums. Visual Basic Express Edition. Visual Basic Express Edition https: Sign in to vote. Friday, January 11, Friday, January 11, 6: Friday, January 11, 9: I am sure I should understand what you mean but I don’t.

PrintPage Do some setup stuff and print text and graphics using e. Graphics End Sub To print the same stuff to an image I do the following: How do I call DoPrintPage so that it prints to an image?

  CIRCUITS FAWWAZ T ULABY MICHEL M MAHARBIZ PDF

Printdocumet am sure this is simple, but I am just not getting it. Using my simple explanation could you show me how? I have read many of your posts and have found your advice quite helpful. Friday, January 11, 2: I think I understand now.

[RESOLVED] Can I create an image from my print document information?

What I did was to put the print code into a sub with an object reference. If I am printing to an image, e is a Graphic. Is this the correct way? Friday, January 11, 4: It is completely obvious now. I am doing the same thing only not as clearly. printdocjment

I like how the resolution of the bitmap is controlled as well. I do have a probably stupid question. Friday, September 30, wave Help us improve MSDN.