By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,223 Members | 1,392 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,223 IT Pros & Developers. It's quick & easy.

How to create and print a two page document

P: n/a
Mo
Hi,
I have two tiff images which present the front and back of a card. I
need to send these to images to a printer that has a two sided
printing capabilities. I need to send these two images to the print as
page 1 and two of the same document in order for the printer to print
it on the front and back of the document. how do you combine these
images so that they present page 1 and 2 of a document for printing?
The following code shows how far I got but I have a feeling this is
not the best way to go about it. Any ideas is greatly appreciated.

StreamReader streamToPrintFront = new StreamReader(@"C:\front.tif");
StreamReader streamToPrintBack = new StreamReader(@"C:\Back.tif");
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);
pd.Print();
streamToPrint.Close();
PrintImage.Dispose();
PrintObject.Dispose();

private void pd_PrintPage(object sender, PrintPageEventArgs ev)
{
// Draw a picture.
Rectangle Rect = new Rectangle();
Rect.Width = 350;
Rect.Height = 530;
ev.Graphics.DrawImage(Image.FromFile("C:\\dd.tif") , Rect);

// Indicate that this is the last page to print.
ev.HasMorePages = false;
}

Apr 25 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
http://msdn2.microsoft.com/en-us/lib...gs.duplex.aspx

"Mo" <le******@yahoo.comwrote in message
news:11**********************@r35g2000prh.googlegr oups.com...
Hi,
I have two tiff images which present the front and back of a card. I
need to send these to images to a printer that has a two sided
printing capabilities. I need to send these two images to the print as
page 1 and two of the same document in order for the printer to print
it on the front and back of the document. how do you combine these
images so that they present page 1 and 2 of a document for printing?
The following code shows how far I got but I have a feeling this is
not the best way to go about it. Any ideas is greatly appreciated.

StreamReader streamToPrintFront = new StreamReader(@"C:\front.tif");
StreamReader streamToPrintBack = new StreamReader(@"C:\Back.tif");
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);
pd.Print();
streamToPrint.Close();
PrintImage.Dispose();
PrintObject.Dispose();

private void pd_PrintPage(object sender, PrintPageEventArgs ev)
{
// Draw a picture.
Rectangle Rect = new Rectangle();
Rect.Width = 350;
Rect.Height = 530;
ev.Graphics.DrawImage(Image.FromFile("C:\\dd.tif") , Rect);

// Indicate that this is the last page to print.
ev.HasMorePages = false;
}

Apr 25 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.