David
David

Reputation: 2563

Printing in C#/.NET, scaling on a whole page

I am wondering how to do the following ( couldn't get google to help me here ):

How would i start here? I have really no idea which classes or methods to use for this...

Also it'd be interesting to know which "formats" i can create the documents in...

Thanks for any help!

Upvotes: 1

Views: 1694

Answers (1)

stuartd
stuartd

Reputation: 73253

Well, you know how big the image is, and how big the paper is, so it's easy to work out how many you can fit on a page.

Then you'll want to create an instance if the Bitmap class from your jpg, then get a Graphics object from the bitmap, call the Graphics object's DrawString method with your text (plus a font, a brush, and a point). Remember to release the Graphics object or, ideally, wrap it in a using statement.Then, as Henk says, use a PrintDocument to print it - there's an example here of that - and write your images in as required to fill the page using the PrintPageEventArgs' Graphics object.

Upvotes: 1

Related Questions