PC Review


Reply
Thread Tools Rate Thread

How to create and print a two page document

 
 
Mo
Guest
Posts: n/a
 
      25th Apr 2007
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;
}

 
Reply With Quote
 
 
 
 
Glenn
Guest
Posts: n/a
 
      25th Apr 2007
http://msdn2.microsoft.com/en-us/lib...gs.duplex.aspx

"Mo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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;
> }
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't print current page in a mail merged document but it gives thepreceding page cyberdude Microsoft Word Document Management 1 17th May 2008 02:49 AM
Can't print current page in a mail merged document but it gives thepreceding page cyberdude Microsoft Word Document Management 0 17th May 2008 02:11 AM
How do I make the Page 1 of 9, Page 2 of 9, print on my document? =?Utf-8?B?V29vZHkgTG9uZ21pcmU=?= Microsoft Word Document Management 1 20th Oct 2005 10:50 PM
I want to print 1 page of a multi page document. How? =?Utf-8?B?TGFkeUJvbnpv?= Microsoft Access Getting Started 2 17th Sep 2005 04:13 PM
When I print a mulitple page document, the last page prints first =?Utf-8?B?UGxhdG9vbk1vbUxpc2FT?= Microsoft Word Document Management 2 13th May 2005 04:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:03 PM.